Back to index

salome-geom  6.5.0
GEOM_OCCReader.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
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 GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  GEOM OBJECT : interactive object for Geometry entities visualization
00024 //  File   : GEOM_OCCReader.h
00025 //  Author : Christophe ATTANASIO
00026 //  Module : GEOM
00027 //  $Header: /home/server/cvs/GEOM/GEOM_SRC/src/OBJECT/GEOM_OCCReader.h,v 1.8.2.1.6.2.14.1 2012-04-13 05:48:21 vsr Exp $
00028 //
00034 #ifndef GEOM_OCCREADER_H
00035 #define GEOM_OCCREADER_H
00036 
00037 #include "GEOM_OBJECT_defs.hxx"
00038 
00039 #include <vtkPolyDataSource.h>
00040 
00041 class vtkPoints;
00042 class vtkCellArray;
00043 
00044 // OpenCASCADE
00045 #include <TopoDS_Shape.hxx>
00046 #include <TopoDS.hxx>
00047 #include <GeomAbs_IsoType.hxx>
00048 #include <BRepAdaptor_Surface.hxx>
00049 
00050 class GEOM_OBJECT_EXPORT GEOM_OCCReader : public vtkPolyDataSource {
00051 
00052   // methods    
00053 
00054  public:        
00055 
00056   static GEOM_OCCReader* New();
00057 
00058   const TopoDS_Shape& getTopo();
00059 
00060   void setTopo(const TopoDS_Shape& ashape, bool isVector = false);
00061 
00062   int  getDisplayMode();
00063   void setDisplayMode(int);
00064 
00065   void setForceUpdate(Standard_Boolean bol);
00066 
00067  protected:
00068 
00069   GEOM_OCCReader();
00070   ~GEOM_OCCReader();
00071   void Execute();       
00072 
00073   void ComputeShading(vtkPoints* Pts,vtkCellArray* Cells);
00074   void ComputeWireframe(vtkPoints* Pts,vtkCellArray* Cells);
00075 
00076   void TransferFaceSData(const TopoDS_Face& aFace,
00077                          vtkPoints* Pts,
00078                          vtkCellArray* Cells);
00079 
00080   void TransferFaceWData(const TopoDS_Face& aFace,
00081                          vtkPoints* Pts,
00082                          vtkCellArray* Cells);
00083 
00084   void TransferEdgeSData(const TopoDS_Edge& aEdge,
00085                          vtkPoints* Pts,
00086                          vtkCellArray* Cells);
00087 
00088   void TransferEdgeWData(const TopoDS_Edge& aEdge,
00089                          vtkPoints* Pts,
00090                          vtkCellArray* Cells);
00091 
00092   void TransferVertexWData(const TopoDS_Vertex& aVertex,
00093                            vtkPoints* Pts,
00094                            vtkCellArray* Cells);
00095 
00096   void createISO(const TopoDS_Face &, 
00097                  double, int,
00098                  vtkPoints* Pts,
00099                  vtkCellArray* Cells);
00100   
00101   void DrawIso(GeomAbs_IsoType aType,
00102                Standard_Real PParm,
00103                Standard_Real p1,
00104                Standard_Real p2,
00105                vtkPoints* Pts,
00106                vtkCellArray* Cells,
00107                Standard_Integer& startidx);
00108   
00109   void MoveTo(gp_Pnt P,
00110               vtkPoints* Pts);
00111 
00112   void DrawTo(gp_Pnt P,
00113               vtkPoints* Pts,
00114               vtkCellArray* Cells);
00115 
00116   void PlotIso(BRepAdaptor_Surface& S, 
00117                GeomAbs_IsoType T,
00118                Standard_Real& U, 
00119                Standard_Real& V, 
00120                Standard_Real Step, 
00121                Standard_Boolean& halt,
00122                vtkPoints* Pts,
00123                vtkCellArray* Cells);
00124 
00125   // fields
00126 
00127  private:
00128 
00129   Standard_Boolean       forced;
00130   int                    discretiso;
00131   int                    amode;
00132   int                    nbisos;
00133   TopoDS_Shape           myShape;
00134   bool                   myIsVector;
00135 
00136 };
00137 
00138 #endif //GEOM_OCCREADER_H