Changeset View
Changeset View
Standalone View
Standalone View
objects/line_imp.cc
Context not available. | |||||
100 | 100 | | |||
---|---|---|---|---|---|
101 | int SegmentImp::numberOfProperties() const | 101 | int SegmentImp::numberOfProperties() const | ||
102 | { | 102 | { | ||
103 | return Parent::numberOfProperties() + 5; | 103 | return Parent::numberOfProperties() + 6; | ||
104 | } | 104 | } | ||
105 | 105 | | |||
106 | const QByteArrayList SegmentImp::propertiesInternalNames() const | 106 | const QByteArrayList SegmentImp::propertiesInternalNames() const | ||
Context not available. | |||||
108 | QByteArrayList s = Parent::propertiesInternalNames(); | 108 | QByteArrayList s = Parent::propertiesInternalNames(); | ||
109 | s << "length"; | 109 | s << "length"; | ||
110 | s << "mid-point"; | 110 | s << "mid-point"; | ||
111 | s << "golden-point"; | ||||
111 | s << "support"; | 112 | s << "support"; | ||
112 | s << "end-point-A"; | 113 | s << "end-point-A"; | ||
113 | s << "end-point-B"; | 114 | s << "end-point-B"; | ||
Context not available. | |||||
120 | QByteArrayList s = Parent::properties(); | 121 | QByteArrayList s = Parent::properties(); | ||
121 | s << I18N_NOOP( "Length" ); | 122 | s << I18N_NOOP( "Length" ); | ||
122 | s << I18N_NOOP( "Mid Point" ); | 123 | s << I18N_NOOP( "Mid Point" ); | ||
124 | s << I18N_NOOP( "Golden Point" ); | ||||
123 | s << I18N_NOOP( "Support Line" ); | 125 | s << I18N_NOOP( "Support Line" ); | ||
124 | s << I18N_NOOP( "First End Point" ); | 126 | s << I18N_NOOP( "First End Point" ); | ||
125 | s << I18N_NOOP( "Second End Point" ); | 127 | s << I18N_NOOP( "Second End Point" ); | ||
Context not available. | |||||
143 | return "distance"; // length | 145 | return "distance"; // length | ||
144 | else if ( which == Parent::numberOfProperties() + pnum++ ) | 146 | else if ( which == Parent::numberOfProperties() + pnum++ ) | ||
145 | return "segment_midpoint"; // mid point | 147 | return "segment_midpoint"; // mid point | ||
148 | else if ( which == Parent::numberOfProperties() + pnum++ ) | ||||
149 | return "segment_golden_point"; // golden point | ||||
146 | else if ( which == Parent::numberOfProperties() + pnum++ ) | 150 | else if ( which == Parent::numberOfProperties() + pnum++ ) | ||
147 | return ""; // support line | 151 | return ""; // support line | ||
148 | else if ( which == Parent::numberOfProperties() + pnum++ ) | 152 | else if ( which == Parent::numberOfProperties() + pnum++ ) | ||
Context not available. | |||||
163 | return new DoubleImp( mdata.dir().length() ); | 167 | return new DoubleImp( mdata.dir().length() ); | ||
164 | else if ( which == Parent::numberOfProperties() + pnum++ ) | 168 | else if ( which == Parent::numberOfProperties() + pnum++ ) | ||
165 | return new PointImp( ( mdata.a + mdata.b ) / 2 ); | 169 | return new PointImp( ( mdata.a + mdata.b ) / 2 ); | ||
170 | else if ( which == Parent::numberOfProperties() + pnum++ ) | ||||
171 | return new PointImp( mdata.a + (3 - sqrt(5)) / 2 * (mdata.b - mdata.a) ); | ||||
166 | else if ( which == Parent::numberOfProperties() + pnum++ ) | 172 | else if ( which == Parent::numberOfProperties() + pnum++ ) | ||
167 | return new LineImp( mdata.a, mdata.b ); | 173 | return new LineImp( mdata.a, mdata.b ); | ||
168 | else if ( which == Parent::numberOfProperties() + pnum++ ) | 174 | else if ( which == Parent::numberOfProperties() + pnum++ ) | ||
Context not available. |