Files Classes Functions Hierarchy
#include <planepointsurface.h>
Public Member Functions | |
| planepointsurface (plane &_pln) | |
| Need a plane to display. | |
| void | scaleSet (doublec s) |
| Globaly scale the two axeses together. | |
| void | operator() (bool &accept, double &x, double &y, double &z, doublec u, doublec v) |
| Generate a point of the surface with u and v in unit square. | |
Public Attributes | |
| plane & | pln |
| The plane this surface represents. | |
| double | uoffset |
| u is shifted before being scaled. | |
| double | voffset |
| v is shifted before being scaled. | |
| double | uscale |
| u axis is scaled. | |
| double | vscale |
| v axis is scaled. | |
This class is designed to be used with the pointsurface class. Essentially this class is a function which is a plane surface.
The client can set the scale and offset for the u and v variables. So when the operator () is called where on the plane the rectangular patch is generated can be controlled.
plane P1(nml,d); ... planepointsurface f1(P1); // Say how many surface points to generate. pointsurface<> ps1(4000); // Color the points. ps1.pre.push(new gobjglColor3ub(184,134,11) ); ps1.addsurface2D(f1); gobjpush(&ps1);
Definition at line 31 of file planepointsurface.h.
| planepointsurface::planepointsurface | ( | plane & | _pln | ) | [inline] |
| void planepointsurface::operator() | ( | bool & | accept, | |
| double & | x, | |||
| double & | y, | |||
| double & | z, | |||
| doublec | u, | |||
| doublec | v | |||
| ) |
Generate a point of the surface with u and v in unit square.
Definition at line 6 of file planepointsurface.cpp.
References point3< T >::x, point3< T >::y, and point3< T >::z.
00014 { 00015 ++state; 00016 state %=3; 00017 00018 doublec u2 = (uoffset + u)*uscale; 00019 doublec v2 = (voffset + v)*vscale; 00020 00021 point3<double> & nml(pln.nml); 00022 00023 accept=false; 00024 00025 switch (state) 00026 { 00027 case 0: 00028 if (nml.z*nml.z<zero<double>::val) 00029 return; 00030 00031 x = u2; 00032 y = v2; 00033 z = (pln.d0-u2*nml.x-v2*nml.y)/nml.z; 00034 accept=true; 00035 break; 00036 00037 case 1: 00038 if (nml.x*nml.x<zero<double>::val) 00039 return; 00040 00041 y = u2; 00042 z = v2; 00043 x = (pln.d0-u2*nml.y-v2*nml.z)/nml.x; 00044 accept=true; 00045 break; 00046 00047 case 2: 00048 if (nml.y*nml.y<zero<double>::val) 00049 return; 00050 00051 x = u2; 00052 z = v2; 00053 y = (pln.d0-u2*nml.x-v2*nml.z)/nml.y; 00054 accept=true; 00055 break; 00056 } 00057 }
| void planepointsurface::scaleSet | ( | doublec | s | ) | [inline] |
Globaly scale the two axeses together.
Definition at line 55 of file planepointsurface.h.
References uscale, and vscale.
Referenced by planeinttest::test01().
| double planepointsurface::uoffset |
| double planepointsurface::uscale |
| double planepointsurface::voffset |
| double planepointsurface::vscale |
1.5.8