Product Idealization Transformations(Implementation)
double pwb::total_diagonal( double width , double length ){
return( sqrt( width*width + length*length ) );
double pwb :: width( ListOfxy_coordinates *anOutline )
double x , y , xMax , xMin , yMax , yMin;
xMax = anOutline->get(0)->x();
yMax = anOutline->get(0)->y();
for( int i = 0 ; i < anOutline->size() ; i++ )
x = anOutline->get(i)->x();
y = anOutline->get(i)->y();
if( deltaX <= deltaY ) return( deltaX );
Notes:
- However, the EXPRESS to C++ compiler does not automatically generate the appropriate access functions from the WHERE rules, and therefore they were implemented manually for TIGER.
- This slide shows two possible member functions created from wr3 and wr1, respectively.
- The first member function (pwb::width) can be used to obtain the value of the width from the outline, and the second (pwb::total_diagonal) to calculate the total diagonal from the width and the length.