SoFCMeshVertex.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2006 Werner Mayer <werner.wm.mayer@gmx.de>              *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
00010  *                                                                         *
00011  *   This library  is distributed in the hope that it will be useful,      *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 #ifndef MESHGUI_SOFCMESHVERTEX_H
00024 #define MESHGUI_SOFCMESHVERTEX_H
00025 
00026 #include <Inventor/fields/SoSField.h>
00027 #include <Inventor/fields/SoSubField.h>
00028 #include <Inventor/nodes/SoSubNode.h>
00029 #include <Inventor/elements/SoReplacedElement.h>
00030 #include <Mod/Mesh/App/Core/Elements.h>
00031 
00032 namespace MeshGui {
00033 
00034 class MeshGuiExport SoSFMeshPointArray : public SoSField {
00035   typedef SoSField inherited;
00036 
00037   SO_SFIELD_HEADER(SoSFMeshPointArray, MeshCore::MeshPointArray*, MeshCore::MeshPointArray*);
00038 
00039 public:
00040   static void initClass(void);
00041   void setValue(const MeshCore::MeshPointArray& p);
00042 
00043 protected:
00044   SbBool readBinaryValues(SoInput * in, unsigned long numarg);
00045   SbBool read1Value(SoInput * in, unsigned long idx);
00046   void writeBinaryValues(SoOutput * out) const;
00047   void write1Value(SoOutput * out, unsigned long idx) const;
00048   int getNumValuesPerLine() const;
00049 };
00050 
00051 // -------------------------------------------------------
00052 
00053 class MeshGuiExport SoFCMeshVertexElement : public SoReplacedElement {
00054   typedef SoReplacedElement inherited;
00055 
00056   SO_ELEMENT_HEADER(SoFCMeshVertexElement);
00057 
00058 public:
00059   static void initClass(void);
00060 
00061   virtual void init(SoState * state);
00062   static void set(SoState * const state, SoNode * const node, const MeshCore::MeshPointArray * const coords);
00063   static const MeshCore::MeshPointArray * get(SoState * const state);
00064   static const SoFCMeshVertexElement * getInstance(SoState * state);
00065   virtual void print(FILE * file) const;
00066 
00067 protected:
00068   virtual ~SoFCMeshVertexElement();
00069   const MeshCore::MeshPointArray *coords3D;
00070 };
00071 
00072 // -------------------------------------------------------
00073 
00074 class MeshGuiExport SoFCMeshVertex : public SoNode {
00075   typedef SoSField inherited;
00076 
00077   SO_NODE_HEADER(SoFCMeshVertex);
00078 
00079 public:
00080   static void initClass(void);
00081   SoFCMeshVertex(void);
00082 
00083   SoSFMeshPointArray point;
00084 
00085   virtual void doAction(SoAction * action);
00086   virtual void GLRender(SoGLRenderAction * action);
00087   virtual void callback(SoCallbackAction * action);
00088   virtual void getBoundingBox(SoGetBoundingBoxAction * action);
00089   virtual void pick(SoPickAction * action);
00090   virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
00091 
00092 protected:
00093   virtual ~SoFCMeshVertex();
00094 };
00095 
00096 } // namespace MeshGui
00097 
00098 
00099 #endif // MESHGUI_SOFCMESHVERTEX_H
00100 

Generated on Wed Nov 23 19:00:40 2011 for FreeCAD by  doxygen 1.6.1