Back to index

salome-geom  6.5.0
GEOM_EdgeSource.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #ifndef GEOM_EDGESOURCE_H 
00021 #define GEOM_EDGESOURCE_H 
00022  
00023 #include "OCC2VTK.h" 
00024  
00025 #include <TopoDS_Edge.hxx> 
00026 #include <NCollection_Set.hxx> 
00027  
00028 typedef NCollection_Set<TopoDS_Edge> TEdgeSet; 
00029  
00030 #include <vtkPoints.h> 
00031 #include <vtkPolyDataSource.h> 
00032 
00033 class OCC2VTK_EXPORT GEOM_EdgeSource: public vtkPolyDataSource 
00034 { 
00035 public: 
00036   vtkTypeMacro(GEOM_EdgeSource,vtkPolyDataSource); 
00037   static GEOM_EdgeSource* New(); 
00038  
00039   void AddEdge (const TopoDS_Edge& theEdge,
00040                 bool theIsVector = false);
00041   void Clear(){ myEdgeSet.Clear();}
00042   
00043   void SetVectorMode(bool);
00044 
00045   bool GetVectorMode();
00046  
00047   static  
00048   void OCC2VTK(const TopoDS_Edge& theEdge,  
00049                vtkPolyData* thePolyData, 
00050                vtkPoints* thePts,
00051                bool theIsVector = false); 
00052 
00053   bool IsEmpty(){return myEdgeSet.IsEmpty();}
00054 
00055  
00056 protected: 
00057   TEdgeSet myEdgeSet;
00058   // The <myIsVector> flag is common for all edges, because the shape,
00059   // representing a vector, can have only one edge.
00060   bool myIsVector, myIsVectorMode;
00061  
00062   void Execute(); 
00063  
00064   GEOM_EdgeSource(); 
00065   ~GEOM_EdgeSource(); 
00066  
00067 private: 
00068   // Not implememnted 
00069   GEOM_EdgeSource(const GEOM_EdgeSource&); 
00070   void operator=(const GEOM_EdgeSource&); 
00071 }; 
00072  
00073  
00074 #endif //GEOM_EDGESOURCE_H