/[gzz]/gzz/gfx/libcoords/Coords.hxx
ViewVC logotype

Diff of /gzz/gfx/libcoords/Coords.hxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by tjl, Wed Sep 25 16:39:26 2002 UTC revision 1.6 by tjl, Thu Sep 26 08:31:24 2002 UTC
# Line 8  namespace Coords { Line 8  namespace Coords {
8      using std::vector;      using std::vector;
9      using std::cout;      using std::cout;
10      using namespace Vec23;      using namespace Vec23;
11    
12      class CoordSys {      class CoordSys {
13      protected:      protected:
14          CoordSys *super;          CoordSys *super;
15          float *params;          float *params;
16            CoordSys *inverse;
17            virtual CoordSys *createInverse() ;
18      public:      public:
19          virtual void setSuper(CoordSys *super) {          virtual void setSuper(CoordSys *super) {
20              this->super = super;              this->super = super;
# Line 20  namespace Coords { Line 23  namespace Coords {
23              this->params = params;              this->params = params;
24          }          }
25    
26            /** Get the inverse of this coordinate system.
27             * Always returns non-null but it is not guaranteed
28             * that this will work properly. (XXX canInvert())
29             * The returned inverse is owned by this object and
30             * mustn't be deleted by the caller.
31             */
32            CoordSys *getInverse() {
33                if(!inverse)
34                    inverse = createInverse();
35                return inverse;
36            }
37    
38          // For Pt as well?          // For Pt as well?
39                    
40          /** Call glVertex with the given ZPt transformed          /** Call glVertex with the given ZPt transformed
# Line 55  namespace Coords { Line 70  namespace Coords {
70           */           */
71          virtual bool performGL() ;          virtual bool performGL() ;
72    
73          virtual ~CoordSys() { }          CoordSys() : super(0), params(0), inverse(0) {
74            }
75            virtual ~CoordSys() {
76                if(inverse) delete inverse;
77            }
78    
79          virtual void dump() {          virtual void dump() {
80              cout << "Unknown coordsys\n";              cout << "Unknown coordsys\n";

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26