00001
00042 #ifndef __GG_NODE_H__
00043 #define __GG_NODE_H__
00044
00045 #include "DAGNode.h"
00046 #include "String.h"
00047
00048
00055 class GGRelation
00056 {
00057 public:
00058 int m_nType;
00059 double m_dScaleRatio;
00060 double m_dOrient;
00061 double m_dDist1;
00062 double m_dDist2;
00063 double m_dBearing;
00064
00065 public:
00066
00067 GGRelation() { memset(this, 0, sizeof(*this)); }
00068
00069 GGRelation(const GGRelation& rhs) { operator=(rhs); }
00070
00071 GGRelation& operator=(const GGRelation& rhs)
00072 {
00073 memcpy(this, &rhs, sizeof(*this));
00074 return *this;
00075 }
00076
00077 istream& Read(istream& is);
00078 ostream& Write(ostream& os) const;
00079 void Print(ostream& os) const;
00080
00081 friend istream& operator>>(istream& is, GGRelation& rel);
00082 friend ostream& operator<<(ostream& os, const GGRelation& rel);
00083 };
00084
00091 class GGNode : public DAGNode
00092 {
00093 public:
00094 int m_nType;
00095 double m_dSign;
00096 double m_dScale;
00097 int m_nXPos;
00098 int m_nYPos;
00099 double m_dA;
00100 double m_dB;
00101 double m_dOrientation;
00102 double m_dAnisotropy;
00103 double m_dUnkField;
00104
00105 int m_nNodeIndex;
00106
00107 SmartArray<double> m_xCoords;
00108 SmartArray<double> m_weights;
00109 SmartArray<double> m_scales;
00110
00111 virtual DAGNode* CreateObject() const;
00112
00113
00114 public:
00115
00116 GGNode(NODE_LABEL lbl = "") : DAGNode(lbl) { }
00117 GGNode(const GGNode &sb) { GGNode::operator=(sb); }
00118
00119 virtual void Clear();
00120 virtual DAGNode& operator=(const DAGNode& rhs);
00121 virtual void Print(ostream& os = cout) const;
00122 virtual istream& Read(istream& is);
00123 virtual ostream& Write(ostream& os) const;
00124 };
00125
00126 #endif //__GG_NODE_H__