24#ifndef DRC_RE_ABSOLUTE_LENGTH_TWO_CONSTRAINT_DATA_H_
25#define DRC_RE_ABSOLUTE_LENGTH_TWO_CONSTRAINT_DATA_H_
45 wxString aRuleName ) :
86 result.AddError(
_(
"Minimum Length must be greater than 0" ) );
89 result.AddError(
_(
"Optimum Length must be greater than 0" ) );
92 result.AddError(
_(
"Maximum Length must be greater than 0" ) );
96 result.AddError(
_(
"Minimum Length cannot be greater than Optimum Length" ) );
99 result.AddError(
_(
"Optimum Length cannot be greater than Maximum Length" ) );
102 result.AddError(
_(
"Minimum Length cannot be greater than Maximum Length" ) );
109 auto formatDistance = [](
double aValue )
117 code = wxS(
"length" );
119 wxString clause = wxString::Format(
120 wxS(
"(constraint %s (min %s) (opt %s) (max %s))" ),
178 wxString skewClause = wxString::Format(
180 clauses.push_back( skewClause );
BITMAPS
A list of all bitmap identifiers.
@ constraint_absolute_length_2
@ constraint_matched_length_diff_pair
VALIDATION_RESULT Validate() const override
Validates the constraint data.
DRC_RE_ABSOLUTE_LENGTH_TWO_CONSTRAINT_DATA()=default
double GetMaximumLength() const
DRC_RE_ABSOLUTE_LENGTH_TWO_CONSTRAINT_DATA(int aId, int aParentId, double aMinLength, double aOptLength, double aMaxLength, wxString aRuleName)
BITMAPS GetOverlayBitmap() const override
Returns the bitmap to use for the overlay panel background.
void SetMinimumLength(double aLength)
double GetOptimumLength() const
void SetOptimumLength(double aLength)
wxString GenerateRule(const RULE_GENERATION_CONTEXT &aContext) override
std::vector< wxString > GetConstraintClauses(const RULE_GENERATION_CONTEXT &aContext) const override
Returns just the constraint clauses without the rule wrapper.
void CopyFrom(const ICopyable &aSource) override
std::vector< DRC_RE_FIELD_POSITION > GetFieldPositions() const override
Returns the field positions for controls overlaid on the constraint bitmap.
double GetMinimumLength() const
DRC_RE_ABSOLUTE_LENGTH_TWO_CONSTRAINT_DATA(const DRC_RE_BASE_CONSTRAINT_DATA &aBaseData)
virtual ~DRC_RE_ABSOLUTE_LENGTH_TWO_CONSTRAINT_DATA()=default
void SetMaximumLength(double aLength)
wxString GetConstraintCode() const
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_ABSOLUTE_LENGTH_TWO_CONSTRAINT_DATA()=default
std::vector< DRC_RE_FIELD_POSITION > GetFieldPositions() const override
Returns the field positions for controls overlaid on the constraint bitmap.
double GetMaxSkew() const
BITMAPS GetOverlayBitmap() const override
Returns the bitmap to use for the overlay panel background.
void CopyFrom(const ICopyable &aSource) override
std::vector< wxString > GetConstraintClauses(const RULE_GENERATION_CONTEXT &aContext) const override
Returns just the constraint clauses without the rule wrapper.
void SetMaxSkew(double aSkew)
Abstract interface class to enable polymorphic copying between objects.
@ RIGHT
Label to the right of the field.
Result of a validation operation.
wxString result
Test unit parsing edge cases and error handling.