24#ifndef DRC_RE_ALLOWED_ORIENTATION_CONSTRAINT_DATA_H_
25#define DRC_RE_ALLOWED_ORIENTATION_CONSTRAINT_DATA_H_
42 int aId,
int aParentId,
bool aAllowZeroDegreess,
bool aAllowNinetyDegreess,
43 bool aAllowOneEightyDegreess,
bool aAllowTwoSeventyDegreess,
bool aAllowAllDegreess,
44 wxString aRuleName ) :
74 return { wxS(
"(constraint assertion \"A.Orientation == A.Orientation\")" ) };
79 terms.Add( wxS(
"A.Orientation == 0 deg" ) );
82 terms.Add( wxS(
"A.Orientation == 90 deg" ) );
85 terms.Add( wxS(
"A.Orientation == 180 deg" ) );
88 terms.Add( wxS(
"A.Orientation == 270 deg" ) );
93 wxString expr = wxJoin( terms,
'|' );
94 expr.Replace( wxS(
"|" ), wxS(
" || " ) );
96 wxString clause = wxString::Format( wxS(
"(constraint assertion \"%s\")" ), expr );
114 result.AddError(
_(
"At least one orientation must be selected" ) );
BITMAPS
A list of all bitmap identifiers.
@ constraint_allowed_orientation
bool GetIsZeroDegreesAllowed()
DRC_RE_ALLOWED_ORIENTATION_CONSTRAINT_DATA()=default
bool m_allowOneEightyDegrees
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
wxString GenerateRule(const RULE_GENERATION_CONTEXT &aContext) override
bool m_allowTwoSeventyDegrees
DRC_RE_ALLOWED_ORIENTATION_CONSTRAINT_DATA(const DRC_RE_BASE_CONSTRAINT_DATA &aBaseData)
bool GetIsOneEightyDegreesAllowed()
bool GetIsNinetyDegreesAllowed()
std::vector< DRC_RE_FIELD_POSITION > GetFieldPositions() const override
Returns the field positions for controls overlaid on the constraint bitmap.
virtual ~DRC_RE_ALLOWED_ORIENTATION_CONSTRAINT_DATA()=default
void SetIsZeroDegreesAllowed(bool aAllowZeroDegreess)
void SetIsTwoSeventyDegreesAllowed(bool aAllowTwoSeventyDegrees)
bool m_allowNinetyDegrees
VALIDATION_RESULT Validate() const override
Validates the constraint data.
BITMAPS GetOverlayBitmap() const override
Returns the bitmap to use for the overlay panel background.
bool GetIsAllDegreesAllowed()
void SetIsNinetyDegreesAllowed(bool aAllowNinetyDegrees)
void SetIsOneEightyDegreesAllowed(bool aAllowOneEightyDegrees)
void SetIsAllDegreesAllowed(bool aAllowAllDegrees)
DRC_RE_ALLOWED_ORIENTATION_CONSTRAINT_DATA(int aId, int aParentId, bool aAllowZeroDegreess, bool aAllowNinetyDegreess, bool aAllowOneEightyDegreess, bool aAllowTwoSeventyDegreess, bool aAllowAllDegreess, wxString aRuleName)
bool GetIsTwoSeventyDegreesAllowed()
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
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.