00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00023 #ifndef INCLUDE_3D_PRIMITIVE_H
00024 #define INCLUDE_3D_PRIMITIVE_H
00025
00026 #include "3d.h"
00027 #include "layout.h"
00028 #include "face.h"
00029 #include "control.h"
00030
00035 class Primitive
00036 {
00037 private:
00038 MyStack<FaceNode *> stack;
00039 FaceNode * AddBox (char *name,int idControl,BOOL isDynamic,GLdouble *depth,BOOL viewBack);
00040 void GetCornersRecursive(FaceNode *faceNode,BOOL isObjective,Point3D<double> *points);
00041
00042 public:
00043 MyTree<Face> tree;
00044
00045 Primitive();
00046 ~Primitive();
00047 void Push();
00048 void Pop();
00049 FaceNode * Peek();
00050
00051 FaceNode * GoTo(int childNumber);
00052 FaceNode * GoTo(FaceNode *node);
00053 FaceNode * GoToParent();
00054
00055 void ViewDebug(FaceNode *node=NULL);
00056 BOOL Draw(BOOL isPicking);
00057 BOOL Draw(FaceNode *node,BOOL isPicking);
00058 FaceNode * Find(int idControl,int idFace,FaceNode *node=NULL);
00059 void BeginContainer(int idControl,double xConstCenter,double xPercentCenter,double yConstCenter,double yPercentCenter,double xConstSize,double xPercentSize,double yConstSize,double yPercentSize);
00060 void EndContainer();
00061 FaceNode * AddFace (char *name,int idControl,int idFace,BOOL view);
00062 FaceNode * AddFace (char *name,int idControl,int idFace,BOOL view,double xConstCenter,double xPercentCenter,double yConstCenter,double yPercentCenter,double zConstCenter,double xConstSize,double xPercentSize,double yConstSize,double yPercentSize);
00063 FaceNode * AddBox (char *name,int idControl,GLdouble depth,BOOL viewBack);
00064 FaceNode * AddBox (char *name,int idControl,GLdouble *depth,BOOL viewBack);
00065 Point2D<double> GetLocalPos(FaceNode *faceNode,Point2D<double> absolutePos);
00066 void GetCorners(FaceNode *faceNode,Point3D<double> *points);
00067 void ComputeLayout(FaceNode *faceNode);
00068 BOOL ReOrderForBlending(FaceNode *faceNode);
00069 void ReOrderForBlending();
00070
00071
00072 };
00073
00074 #endif