Gizmo3D

gzClipPlane.h

Go to the documentation of this file.
00001 //*****************************************************************************
00002 // File         : gzClipPlane.h
00003 // Module       : 
00004 // Description  : Class definition of the gzClipPlane class
00005 // Author       : Anders Modén      
00006 // Product      : Gizmo3D 2.1.1
00007 //      
00008 // Copyright © 2003- Saab Training Systems AB, Sweden   
00009 //          
00010 // NOTE:    Gizmo3D is a high performance 3D Scene Graph and effect visualisation 
00011 //          C++ toolkit for Linux, Mac OS X, Windows (Win32) and IRIX® for  
00012 //          usage in Game or VisSim development.
00013 //
00014 //
00015 // Revision History...                          
00016 //                                  
00017 // Who  Date    Description                     
00018 //                                  
00019 // AMO  990831  Created file    
00020 //
00021 //******************************************************************************
00022 #ifndef __GZ_CLIPPLANE_H__
00023 #define __GZ_CLIPPLANE_H__
00024 
00030 #include "gzBasicTypes.h"
00031 
00032 const gzULong GZ_NUMBER_OF_ACTIVE_CLIP_PLANES=6;
00033 
00034 #include "gzObject.h"
00035 #include "gzMatrix.h"
00036 
00037 class gzContext;    // Forward declaration
00038 
00039 //******************************************************************************
00040 // Class    : gzClipPlane
00041 //                                  
00042 // Purpose  : -
00043 //                                  
00044 // Notes    : - 
00045 //                                  
00046 // Revision History...                          
00047 //                                  
00048 // Who  Date    Description                     
00049 //                                  
00050 // AMO  990831  Created 
00051 //                                  
00052 //******************************************************************************
00053 class gzClip : public gzObject , public gzNameInterface
00054 {
00055 public:
00056     GZ_DECLARE_TYPE_INTERFACE_EXPORT(GZ_GRAPH_EXPORT);  // typed interface
00057 
00058     GZ_GRAPH_EXPORT gzClip(const gzString & name=GZ_EMPTY_STRING);
00059 
00060     GZ_GRAPH_EXPORT virtual ~gzClip(){};
00061     
00062     GZ_GRAPH_EXPORT gzVoid setClipPlane(gzVec3 norm , gzVec3 base);
00063 
00064 
00065     GZ_GRAPH_EXPORT gzVoid  virtual activate(gzContext *context , gzULong clipIndex , gzULong transformIndex);
00066     GZ_GRAPH_EXPORT static gzVoid deactivate(gzContext *context ,gzULong clipIndex );
00067 
00068     GZ_GRAPH_EXPORT gzVoid  flipPlane();
00069 
00070     // ---------- Clone interface ---------------------------------------
00071     GZ_GRAPH_EXPORT virtual gzReference* clone() const;
00072 
00073 private:
00074 
00075     gzDouble a,b,c,d;   // Plane Equation
00076 
00077 };
00078 
00079 //******************************************************************************
00080 // Class    : gzClipState
00081 //                                  
00082 // Purpose  : The actual state of the current clip planes
00083 //                                  
00084 // Notes    : - 
00085 //                                  
00086 // Revision History...                          
00087 //                                  
00088 // Who  Date    Description                     
00089 //                                  
00090 // AMO  991027  Created 
00091 //                                  
00092 //******************************************************************************
00093 class gzClipState 
00094 {
00095 public:
00096 
00097     GZ_GRAPH_EXPORT gzClipState();
00098 
00099     GZ_GRAPH_EXPORT virtual ~gzClipState();
00100 
00101     GZ_GRAPH_EXPORT gzVoid  add(gzClipState &clipState);
00102 
00103     GZ_GRAPH_EXPORT gzVoid addClipPlane( gzClip *plane);
00104     GZ_GRAPH_EXPORT gzVoid removeClipPlane( gzClip *plane);
00105 
00106     GZ_GRAPH_EXPORT gzULong getNumberOfClipPlanes();
00107     GZ_GRAPH_EXPORT gzClip *getClipPlane(gzULong clipIndex);
00108 
00109 
00110     GZ_GRAPH_EXPORT gzVoid setTransformIndex(gzULong index);
00111 
00112     GZ_GRAPH_EXPORT gzVoid activate(gzContext *context);
00113 
00114     GZ_GRAPH_EXPORT gzVoid flipPlanes();
00115 
00116     GZ_GRAPH_EXPORT static gzVoid transferActiveClipStates(gzContext *from , gzContext *to);
00117 
00118 private:
00119 
00120     gzRefPointer<gzClip>        m_clipPlanes[GZ_NUMBER_OF_ACTIVE_CLIP_PLANES];
00121     gzULong                     m_transformIndex[GZ_NUMBER_OF_ACTIVE_CLIP_PLANES];
00122     gzUByte                     m_count;
00123 
00124 };
00125 
00126 #endif

Documentation for Gizmo3D generated at Wed Feb 20 11:54:03 2008 by   Saab Training Systems AB, ¸ (c) 2003-and beyond