Back to index

salome-geom  6.5.0
GEOM_FaceSource.cxx
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 #include "GEOM_FaceSource.h" 
00021  
00022 #include <vtkObjectFactory.h> 
00023 
00024 #include <vtkPoints.h>
00025 #include <vtkCellArray.h>
00026  
00027 #include <vtkPolyDataMapper.h>  
00028 #include <vtkPolyData.h>  
00029  
00030 GEOM_FaceSource::GEOM_FaceSource() 
00031 { 
00032 } 
00033  
00034 GEOM_FaceSource::~GEOM_FaceSource() 
00035 { 
00036 } 
00037  
00038 void  
00039 GEOM_FaceSource:: 
00040 AddFace(const TopoDS_Face& theFace) 
00041 { 
00042   myFaceSet.Add(theFace); 
00043 } 
00044  
00045 void 
00046 GEOM_FaceSource::
00047 MoveTo(gp_Pnt thePnt, 
00048        vtkPoints* thePts)
00049 {    
00050   thePts->InsertNextPoint(thePnt.X(), thePnt.Y(), thePnt.Z());
00051 } 
00052 
00053 void 
00054 GEOM_FaceSource::
00055 DrawTo(gp_Pnt thePnt,
00056        vtkPolyData* thePolyData,
00057        vtkPoints* thePts)
00058 {
00059   vtkIdType anId = 
00060     thePts->InsertNextPoint(thePnt.X(), thePnt.Y(), thePnt.Z());
00061   vtkIdType anIds[2] = {anId-1, anId};
00062   thePolyData->InsertNextCell(VTK_LINE,2,anIds);
00063 }