24#ifndef DRC_RE_MINIMUM_TEXT_HEIGHT_THICKNESS_CONSTRAINT_DATA_H_
25#define DRC_RE_MINIMUM_TEXT_HEIGHT_THICKNESS_CONSTRAINT_DATA_H_
42 const wxString& aRuleName,
43 double aMinTextHeight,
44 double aMinTextThickness ) :
78 result.AddError(
_(
"Minimum Text Height must be greater than 0" ) );
81 result.AddError(
_(
"Minimum Text Thickness must be greater than 0" ) );
88 auto formatDimension = [](
double aValue )
93 wxString heightClause =
94 wxString::Format( wxS(
"(constraint text_height (min %s))" ), formatDimension(
m_minTextHeight ) );
96 wxString thicknessClause = wxString::Format( wxS(
"(constraint text_thickness (min %s))" ),
99 return { heightClause, thicknessClause };
BITMAPS
A list of all bitmap identifiers.
@ constraint_minimum_text_height_and_thickness
static wxString formatDouble(double aValue, int aPrecision=6)
wxString buildRule(const RULE_GENERATION_CONTEXT &aContext, const std::vector< wxString > &aConstraintClauses) const
void CopyFrom(const ICopyable &aSource) override
DRC_RE_BASE_CONSTRAINT_DATA()=default
DRC_RE_MINIMUM_TEXT_HEIGHT_THICKNESS_CONSTRAINT_DATA(int aId, int aParentId, const wxString &aRuleName, double aMinTextHeight, double aMinTextThickness)
VALIDATION_RESULT Validate() const override
Validates the constraint data.
BITMAPS GetOverlayBitmap() const override
Returns the bitmap to use for the overlay panel background.
std::vector< DRC_RE_FIELD_POSITION > GetFieldPositions() const override
Returns the field positions for controls overlaid on the constraint bitmap.
void CopyFrom(const ICopyable &aSource) override
DRC_RE_MINIMUM_TEXT_HEIGHT_THICKNESS_CONSTRAINT_DATA(const DRC_RE_BASE_CONSTRAINT_DATA &aBaseData)
double m_minTextThickness
void SetMinTextThickness(double aMinTextThickness)
DRC_RE_MINIMUM_TEXT_HEIGHT_THICKNESS_CONSTRAINT_DATA()=default
wxString GenerateRule(const RULE_GENERATION_CONTEXT &aContext) override
virtual ~DRC_RE_MINIMUM_TEXT_HEIGHT_THICKNESS_CONSTRAINT_DATA()=default
double GetMinTextHeight()
std::vector< wxString > GetConstraintClauses(const RULE_GENERATION_CONTEXT &aContext) const override
Returns just the constraint clauses without the rule wrapper.
double GetMinTextThickness()
void SetMinTextHeight(double aMinTextHeight)
Abstract interface class to enable polymorphic copying between objects.
constexpr int DRC_RE_OVERLAY_XO
constexpr int DRC_RE_OVERLAY_YO
@ RIGHT
Label to the right of the field.
Result of a validation operation.
wxString result
Test unit parsing edge cases and error handling.