2003-07-09 20:44:57 +06:00
|
|
|
// GEOM OBJECT : interactive object for Geometry entities visualization
|
|
|
|
//
|
|
|
|
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
|
|
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2.1 of the License.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
//
|
2006-06-01 17:32:40 +06:00
|
|
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
2003-07-09 20:44:57 +06:00
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// File : GEOM_Actor.cxx
|
|
|
|
// Author : Christophe ATTANASIO
|
|
|
|
// Module : GEOM
|
2003-05-12 21:09:12 +06:00
|
|
|
// $Header$
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\class GEOM_Actor GEOM_Actor.h
|
|
|
|
\brief This class allows to display an OpenCASCADE CAD model in a VTK viewer.
|
|
|
|
*/
|
2008-03-07 12:45:34 +05:00
|
|
|
#include "GEOM_Actor.h"
|
|
|
|
|
|
|
|
#include "GEOM_DeviceActor.h"
|
|
|
|
#include "GEOM_VertexSource.h"
|
|
|
|
#include "GEOM_EdgeSource.h"
|
|
|
|
#include "GEOM_WireframeFace.h"
|
|
|
|
#include "GEOM_ShadingFace.h"
|
|
|
|
#include "SVTK_Actor.h"
|
|
|
|
|
|
|
|
#include <vtkObjectFactory.h>
|
|
|
|
#include <vtkRenderer.h>
|
|
|
|
#include <vtkProperty.h>
|
|
|
|
#include <vtkPointPicker.h>
|
|
|
|
#include <vtkCellPicker.h>
|
|
|
|
|
|
|
|
#include <TopAbs_ShapeEnum.hxx>
|
|
|
|
#include <TopExp_Explorer.hxx>
|
|
|
|
#include <Poly_Triangulation.hxx>
|
|
|
|
#include <BRepMesh_IncrementalMesh.hxx>
|
|
|
|
#include <Bnd_Box.hxx>
|
|
|
|
#include <TopoDS.hxx>
|
|
|
|
#include <BRep_Tool.hxx>
|
|
|
|
#include <BRepBndLib.hxx>
|
|
|
|
#include <TopTools_ListOfShape.hxx>
|
|
|
|
#include <TopoDS_Iterator.hxx>
|
|
|
|
#include <TopExp.hxx>
|
|
|
|
|
|
|
|
#include <vtkPolyDataWriter.h>
|
|
|
|
|
|
|
|
#include <vtkAppendPolyData.h>
|
|
|
|
#include <vtkPolyDataMapper.h>
|
|
|
|
#include <vtkPolyData.h>
|
2004-12-01 15:39:14 +05:00
|
|
|
#include <vtkTransform.h>
|
|
|
|
#include <vtkMatrix4x4.h>
|
|
|
|
#include <vtkMath.h>
|
|
|
|
#include <vtkCamera.h>
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
//vtkStandardNewMacro(GEOM_Actor);
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
#ifndef MYDEBUG
|
|
|
|
//#define MYDEBUG
|
|
|
|
#endif
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
GEOM_Actor::GEOM_Actor():
|
|
|
|
// myDisplayMode(eWireframe),
|
|
|
|
myIsSelected(false),
|
|
|
|
|
|
|
|
myVertexActor(GEOM_DeviceActor::New(),true),
|
|
|
|
myVertexSource(GEOM_VertexSource::New(),true),
|
|
|
|
|
|
|
|
myIsolatedEdgeActor(GEOM_DeviceActor::New(),true),
|
|
|
|
myIsolatedEdgeSource(GEOM_EdgeSource::New(),true),
|
|
|
|
|
|
|
|
myOneFaceEdgeActor(GEOM_DeviceActor::New(),true),
|
|
|
|
myOneFaceEdgeSource(GEOM_EdgeSource::New(),true),
|
|
|
|
|
|
|
|
mySharedEdgeActor(GEOM_DeviceActor::New(),true),
|
|
|
|
mySharedEdgeSource(GEOM_EdgeSource::New(),true),
|
|
|
|
|
|
|
|
myWireframeFaceActor(GEOM_DeviceActor::New(),true),
|
|
|
|
myWireframeFaceSource(GEOM_WireframeFace::New(),true),
|
|
|
|
|
|
|
|
myShadingFaceActor(GEOM_DeviceActor::New(),true),
|
|
|
|
myShadingFaceSource(GEOM_ShadingFace::New(),true),
|
|
|
|
|
|
|
|
myHighlightActor(GEOM_DeviceActor::New(),true),
|
|
|
|
myAppendFilter(vtkAppendPolyData::New(),true),
|
|
|
|
myPolyDataMapper(vtkPolyDataMapper::New(),true),
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
myHighlightProp(vtkProperty::New()),
|
|
|
|
myPreHighlightProp(vtkProperty::New()),
|
|
|
|
myShadingFaceProp(vtkProperty::New())
|
|
|
|
|
|
|
|
{
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout <<this<< " GEOM_Actor::GEOM_Actor"<<endl;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
myPolyDataMapper->SetInput(myAppendFilter->GetOutput());
|
|
|
|
vtkProperty* aProperty;
|
|
|
|
|
|
|
|
myHighlightProp->SetAmbient(0.5);
|
|
|
|
myHighlightProp->SetDiffuse(0.3);
|
|
|
|
myHighlightProp->SetSpecular(0.2);
|
|
|
|
myHighlightProp->SetRepresentationToSurface();
|
|
|
|
myHighlightProp->SetAmbientColor(1, 1, 1);
|
|
|
|
myHighlightProp->SetDiffuseColor(1, 1, 1);
|
|
|
|
myHighlightProp->SetSpecularColor(0.5, 0.5, 0.5);
|
|
|
|
myHighlightActor->SetProperty(myHighlightProp.GetPointer());
|
|
|
|
|
|
|
|
this->myHighlightActor->SetInput(myAppendFilter->GetOutput(),false);
|
|
|
|
|
|
|
|
myPreHighlightProp->SetColor(0,1,1);
|
|
|
|
myPreHighlightProp->SetPointSize(SALOME_POINT_SIZE+2);
|
|
|
|
myPreHighlightProp->SetLineWidth(SALOME_LINE_WIDTH+1);
|
|
|
|
myPreHighlightProp->SetRepresentationToWireframe();
|
|
|
|
|
|
|
|
myAppendFilter->AddInput(myVertexSource->GetOutput());
|
|
|
|
myVertexActor->SetInput(myVertexSource->GetOutput(),false);
|
|
|
|
aProperty = myVertexActor->GetProperty();
|
|
|
|
aProperty->SetRepresentation(VTK_POINTS);
|
|
|
|
aProperty->SetPointSize(3);
|
|
|
|
aProperty->SetColor(1, 1, 0);
|
|
|
|
|
|
|
|
myAppendFilter->AddInput(myIsolatedEdgeSource->GetOutput());
|
|
|
|
myIsolatedEdgeActor->SetInput(myIsolatedEdgeSource->GetOutput(),false);
|
|
|
|
aProperty = myIsolatedEdgeActor->GetProperty();
|
|
|
|
aProperty->SetRepresentation(VTK_WIREFRAME);
|
|
|
|
aProperty->SetColor(1, 0, 0);
|
|
|
|
|
|
|
|
myAppendFilter->AddInput(myOneFaceEdgeSource->GetOutput());
|
|
|
|
myOneFaceEdgeActor->SetInput(myOneFaceEdgeSource->GetOutput(),false);
|
|
|
|
aProperty = myOneFaceEdgeActor->GetProperty();
|
|
|
|
aProperty->SetRepresentation(VTK_WIREFRAME);
|
|
|
|
aProperty->SetColor(0, 1, 0);
|
|
|
|
|
|
|
|
myAppendFilter->AddInput(mySharedEdgeSource->GetOutput());
|
|
|
|
mySharedEdgeActor->SetInput(mySharedEdgeSource->GetOutput(),false);
|
|
|
|
aProperty = mySharedEdgeActor->GetProperty();
|
|
|
|
aProperty->SetRepresentation(VTK_WIREFRAME);
|
|
|
|
aProperty->SetColor(1, 1, 0);
|
|
|
|
|
|
|
|
myAppendFilter->AddInput(myWireframeFaceSource->GetOutput());
|
|
|
|
myWireframeFaceActor->SetInput(myWireframeFaceSource->GetOutput(),false);
|
|
|
|
aProperty = myWireframeFaceActor->GetProperty();
|
|
|
|
aProperty->SetRepresentation(VTK_WIREFRAME);
|
|
|
|
aProperty->SetColor(0.5, 0.5, 0.5);
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
myShadingFaceActor->SetInput(myShadingFaceSource->GetOutput(),true);
|
|
|
|
|
|
|
|
myShadingFaceProp->SetRepresentation(VTK_SURFACE);
|
|
|
|
myShadingFaceProp->SetInterpolationToGouraud();
|
|
|
|
myShadingFaceProp->SetAmbient(1.0);
|
|
|
|
myShadingFaceProp->SetDiffuse(1.0);
|
|
|
|
myShadingFaceProp->SetSpecular(0.4);
|
|
|
|
myShadingFaceProp->SetAmbientColor(0.329412, 0.223529, 0.027451);
|
|
|
|
myShadingFaceProp->SetDiffuseColor(0.780392, 0.568627, 0.113725);
|
|
|
|
myShadingFaceProp->SetSpecularColor(0.992157, 0.941176, 0.807843);
|
|
|
|
|
|
|
|
myShadingFaceActor->SetProperty(myShadingFaceProp.GetPointer());
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
// Toggle display mode
|
|
|
|
setDisplayMode(0); // WIRE FRAME
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GEOM_Actor::~GEOM_Actor()
|
|
|
|
{
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout <<this<< " ~GEOM_Actor::GEOM_Actor"<<endl;
|
|
|
|
#endif
|
|
|
|
myHighlightProp->Delete();
|
|
|
|
myPreHighlightProp->Delete();
|
|
|
|
myShadingFaceProp->Delete();
|
|
|
|
}
|
|
|
|
|
|
|
|
GEOM_Actor*
|
|
|
|
GEOM_Actor::
|
|
|
|
New()
|
|
|
|
{
|
|
|
|
GEOM_Actor* anObject = new GEOM_Actor();
|
|
|
|
anObject->SetMapper(anObject->myPolyDataMapper.Get());
|
|
|
|
return anObject;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Write(vtkPolyData* theDataSet, const char* theFileName){
|
|
|
|
vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New();
|
|
|
|
cout<<"Write - "<<theFileName<<"' : "<<theDataSet->GetNumberOfPoints()<<"; "<<theDataSet->GetNumberOfCells()<<endl;
|
|
|
|
aWriter->SetInput(theDataSet);
|
|
|
|
aWriter->SetFileName(theFileName);
|
|
|
|
//aWriter->Write();
|
|
|
|
aWriter->Delete();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
GEOM_Actor::
|
|
|
|
SetModified()
|
|
|
|
{
|
|
|
|
this->myVertexSource->Modified();
|
|
|
|
this->myIsolatedEdgeSource->Modified();
|
|
|
|
this->myOneFaceEdgeSource->Modified();
|
|
|
|
this->mySharedEdgeSource->Modified();
|
|
|
|
this->myWireframeFaceSource->Modified();
|
|
|
|
this->myShadingFaceSource->Modified();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
GEOM_Actor::
|
|
|
|
SetMapper(vtkMapper* theMapper)
|
|
|
|
{
|
|
|
|
SALOME_Actor::SetMapper(theMapper);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
GEOM_Actor::
|
|
|
|
AddToRender(vtkRenderer* theRenderer)
|
|
|
|
{
|
|
|
|
//SALOME_Actor::AddToRender(theRenderer);
|
|
|
|
|
|
|
|
theRenderer->AddActor(this);
|
|
|
|
|
|
|
|
this->myHighlightActor->AddToRender(theRenderer);
|
|
|
|
|
|
|
|
|
|
|
|
myShadingFaceActor->AddToRender(theRenderer);
|
|
|
|
myWireframeFaceActor->AddToRender(theRenderer);
|
|
|
|
|
|
|
|
mySharedEdgeActor->AddToRender(theRenderer);
|
|
|
|
myOneFaceEdgeActor->AddToRender(theRenderer);
|
|
|
|
myIsolatedEdgeActor->AddToRender(theRenderer);
|
|
|
|
|
|
|
|
myVertexActor->AddToRender(theRenderer);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
GEOM_Actor::
|
|
|
|
RemoveFromRender(vtkRenderer* theRenderer)
|
2003-05-12 21:09:12 +06:00
|
|
|
{
|
2008-03-07 12:45:34 +05:00
|
|
|
//SALOME_Actor::RemoveFromRender(theRenderer);
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
|
|
|
|
theRenderer->RemoveActor(this);
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
myHighlightActor->RemoveFromRender(theRenderer);
|
|
|
|
myShadingFaceActor->RemoveFromRender(theRenderer);
|
|
|
|
myWireframeFaceActor->RemoveFromRender(theRenderer);
|
|
|
|
|
|
|
|
mySharedEdgeActor->RemoveFromRender(theRenderer);
|
|
|
|
myOneFaceEdgeActor->RemoveFromRender(theRenderer);
|
|
|
|
myIsolatedEdgeActor->RemoveFromRender(theRenderer);
|
|
|
|
|
|
|
|
myVertexActor->RemoveFromRender(theRenderer);
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
|
|
|
|
SetSelected(false);
|
|
|
|
SetVisibility(false);
|
|
|
|
}
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
void
|
|
|
|
GEOM_Actor::
|
|
|
|
setDisplayMode(int theMode)
|
|
|
|
{
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << "GEOM_Actor::SetDisplayMode = "<<theMode <<endl;
|
|
|
|
#endif
|
|
|
|
VTKViewer_Actor::setDisplayMode(theMode);
|
|
|
|
SetVisibility(GetVisibility());
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
GEOM_Actor::
|
|
|
|
SetSelected(bool theIsSelected)
|
|
|
|
{
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << "GEOM_Actor::SetSelected = "<<theIsSelected <<endl;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
myIsSelected = theIsSelected;
|
|
|
|
SetVisibility(GetVisibility());
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
GEOM_Actor::
|
|
|
|
SetVisibility(int theVisibility)
|
|
|
|
{
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << "GEOM_Actor::SetVisibility = "<<theVisibility <<" myIsSelected="<< myIsSelected
|
|
|
|
<< " theVisibility="<<theVisibility<<" myIsPreselected="<<myIsPreselected<<endl;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
SALOME_Actor::SetVisibility(theVisibility);
|
|
|
|
|
|
|
|
this->myHighlightActor->SetVisibility(theVisibility && (myIsSelected || myIsPreselected));
|
|
|
|
|
|
|
|
myShadingFaceActor->SetVisibility(theVisibility && (myDisplayMode == (int)eShading) && (!myIsSelected || !myIsPreselected));
|
|
|
|
myWireframeFaceActor->SetVisibility(theVisibility && (myDisplayMode ==(int)eWireframe) && !myIsSelected);
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
mySharedEdgeActor->SetVisibility(theVisibility && myDisplayMode == (int)eWireframe && !myIsSelected);
|
|
|
|
myOneFaceEdgeActor->SetVisibility(theVisibility && myDisplayMode == (int)eWireframe && !myIsSelected);
|
|
|
|
myIsolatedEdgeActor->SetVisibility(theVisibility && !myIsSelected);
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
myVertexActor->SetVisibility(false);// must be added new mode points
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
2008-03-07 12:45:34 +05:00
|
|
|
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
void
|
|
|
|
GEOM_Actor
|
|
|
|
::SetNbIsos(const int theNb[2])
|
2003-05-12 21:09:12 +06:00
|
|
|
{
|
2008-03-07 12:45:34 +05:00
|
|
|
myNbIsos[0] = theNb[0];
|
|
|
|
myNbIsos[1] = theNb[1];
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
void
|
|
|
|
GEOM_Actor
|
|
|
|
::GetNbIsos(int &theNbU,int &theNbV)
|
2003-05-12 21:09:12 +06:00
|
|
|
{
|
2008-03-07 12:45:34 +05:00
|
|
|
theNbU = myNbIsos[0];
|
|
|
|
theNbV = myNbIsos[1];
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
static
|
|
|
|
void
|
|
|
|
MeshShape(const TopoDS_Shape& theShape,
|
|
|
|
float& theDeflection,
|
|
|
|
bool theIsRelative)
|
|
|
|
{
|
|
|
|
static Standard_Real RELATIVE_DEFLECTION = 0.0001;
|
|
|
|
Standard_Real aDeflection = theDeflection;
|
|
|
|
|
|
|
|
if(theDeflection <= 0) { // Compute default theDeflection
|
|
|
|
Bnd_Box B;
|
|
|
|
BRepBndLib::Add(theShape, B);
|
|
|
|
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
|
|
|
|
B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
|
|
|
|
Standard_Real aDiagonal = (aXmax-aXmin)*(aXmax-aXmin) +
|
|
|
|
(aYmax-aYmin)*(aYmax-aYmin) +
|
|
|
|
(aZmax-aZmin)*(aZmax-aZmin);
|
|
|
|
aDiagonal = sqrt(aDiagonal);
|
|
|
|
aDeflection = aDiagonal*RELATIVE_DEFLECTION;
|
|
|
|
|
|
|
|
if(theIsRelative)
|
|
|
|
theDeflection = RELATIVE_DEFLECTION;
|
|
|
|
else
|
|
|
|
theDeflection = aDeflection;
|
|
|
|
}
|
|
|
|
|
|
|
|
BRepMesh_IncrementalMesh aMesh(theShape,aDeflection);
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
void
|
|
|
|
GEOM_Actor::
|
|
|
|
SetDeflection(float theDeflection, bool theIsRelative)
|
|
|
|
{
|
|
|
|
myDeflection = theDeflection;
|
|
|
|
myIsRelative = theIsRelative;
|
|
|
|
|
|
|
|
MeshShape(myShape,myDeflection,myIsRelative);
|
|
|
|
|
|
|
|
SetModified();
|
|
|
|
}
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
void GEOM_Actor::SetShape (const TopoDS_Shape& theShape,
|
|
|
|
float theDeflection,
|
|
|
|
bool theIsRelative,
|
|
|
|
bool theIsVector)
|
|
|
|
{
|
|
|
|
myShape = theShape;
|
|
|
|
|
|
|
|
myVertexSource->Clear();
|
|
|
|
myIsolatedEdgeSource->Clear();
|
|
|
|
myOneFaceEdgeSource->Clear();
|
|
|
|
mySharedEdgeSource->Clear();
|
|
|
|
myWireframeFaceSource->Clear();
|
|
|
|
myShadingFaceSource->Clear();
|
|
|
|
|
|
|
|
TopExp_Explorer aVertexExp (theShape,TopAbs_VERTEX);
|
|
|
|
for (; aVertexExp.More(); aVertexExp.Next())
|
|
|
|
{
|
|
|
|
const TopoDS_Vertex& aVertex = TopoDS::Vertex(aVertexExp.Current());
|
|
|
|
myVertexSource->AddVertex(aVertex);
|
|
|
|
}
|
|
|
|
SetDeflection(theDeflection, theIsRelative);
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
// look if edges are free or shared
|
|
|
|
TopTools_IndexedDataMapOfShapeListOfShape anEdgeMap;
|
|
|
|
TopExp::MapShapesAndAncestors(theShape,TopAbs_EDGE,TopAbs_FACE,anEdgeMap);
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
SetShape(theShape,anEdgeMap,theIsVector);
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
void GEOM_Actor::SetShape (const TopoDS_Shape& theShape,
|
|
|
|
const TopTools_IndexedDataMapOfShapeListOfShape& theEdgeMap,
|
|
|
|
bool theIsVector)
|
|
|
|
{
|
|
|
|
if (theShape.ShapeType() == TopAbs_COMPOUND) {
|
|
|
|
TopoDS_Iterator anItr(theShape);
|
|
|
|
for (; anItr.More(); anItr.Next()) {
|
|
|
|
SetShape(anItr.Value(),theEdgeMap,theIsVector);
|
|
|
|
}
|
|
|
|
}
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
switch (theShape.ShapeType()) {
|
|
|
|
case TopAbs_WIRE: {
|
|
|
|
TopExp_Explorer anEdgeExp(theShape,TopAbs_EDGE);
|
|
|
|
for (; anEdgeExp.More(); anEdgeExp.Next()){
|
|
|
|
const TopoDS_Edge& anEdge = TopoDS::Edge(anEdgeExp.Current());
|
|
|
|
if (!BRep_Tool::Degenerated(anEdge))
|
|
|
|
myIsolatedEdgeSource->AddEdge(anEdge,theIsVector);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TopAbs_EDGE: {
|
|
|
|
const TopoDS_Edge& anEdge = TopoDS::Edge(theShape);
|
|
|
|
if (!BRep_Tool::Degenerated(anEdge))
|
|
|
|
myIsolatedEdgeSource->AddEdge(anEdge,theIsVector);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case TopAbs_VERTEX: {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
TopExp_Explorer aFaceExp (theShape,TopAbs_FACE);
|
|
|
|
for(; aFaceExp.More(); aFaceExp.Next()) {
|
|
|
|
const TopoDS_Face& aFace = TopoDS::Face(aFaceExp.Current());
|
|
|
|
myWireframeFaceSource->AddFace(aFace);
|
|
|
|
myShadingFaceSource->AddFace(aFace);
|
|
|
|
TopExp_Explorer anEdgeExp(aFaceExp.Current(), TopAbs_EDGE);
|
|
|
|
for(; anEdgeExp.More(); anEdgeExp.Next()) {
|
|
|
|
const TopoDS_Edge& anEdge = TopoDS::Edge(anEdgeExp.Current());
|
|
|
|
if(!BRep_Tool::Degenerated(anEdge)){
|
|
|
|
// compute the number of faces
|
|
|
|
int aNbOfFaces = theEdgeMap.FindFromKey(anEdge).Extent();
|
|
|
|
switch(aNbOfFaces){
|
|
|
|
case 0: // isolated edge
|
|
|
|
myIsolatedEdgeSource->AddEdge(anEdge,theIsVector);
|
|
|
|
break;
|
|
|
|
case 1: // edge in only one face
|
|
|
|
myOneFaceEdgeSource->AddEdge(anEdge,theIsVector);
|
|
|
|
break;
|
|
|
|
default: // edge shared by at least two faces
|
|
|
|
mySharedEdgeSource->AddEdge(anEdge,theIsVector);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
// OLD METHODS
|
|
|
|
void GEOM_Actor::setDeflection(double adef) {
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << "GEOM_Actor::setDeflection"<<endl;
|
|
|
|
#endif
|
|
|
|
SetDeflection((float)adef,GetIsRelative());
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
// warning! must be checked!
|
|
|
|
// SetHighlightProperty
|
|
|
|
// SetWireframeProperty
|
|
|
|
// SetShadingProperty
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
void GEOM_Actor::SetHighlightProperty(vtkProperty* Prop)
|
|
|
|
{
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << "GEOM_Actor::SetHighlightProperty"<<endl;
|
|
|
|
#endif
|
|
|
|
this->myHighlightActor->GetProperty()->DeepCopy(Prop);
|
|
|
|
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
void GEOM_Actor::SetWireframeProperty(vtkProperty* Prop)
|
|
|
|
{
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << this << " GEOM_Actor::SetWireframeProperty"<<endl;
|
|
|
|
#endif
|
|
|
|
// must be filled
|
|
|
|
myWireframeFaceActor->SetProperty(Prop);
|
|
|
|
}
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
void GEOM_Actor::SetShadingProperty(vtkProperty* Prop)
|
|
|
|
{
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << "GEOM_Actor::SetShadingProperty"<<endl;
|
|
|
|
#endif
|
|
|
|
myShadingFaceProp->DeepCopy(Prop);
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
void GEOM_Actor::Render(vtkRenderer *ren, vtkMapper *theMapper)
|
2003-05-12 21:09:12 +06:00
|
|
|
{
|
2008-03-07 12:45:34 +05:00
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << "GEOM_Actor::Render"<<endl;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if(!GetVisibility())
|
|
|
|
return;
|
|
|
|
|
2003-05-12 21:09:12 +06:00
|
|
|
/* render the property */
|
|
|
|
if (!this->Property) {
|
|
|
|
// force creation of a property
|
|
|
|
this->GetProperty();
|
|
|
|
this->Property->SetInterpolation(1);
|
|
|
|
this->Property->SetRepresentationToSurface();
|
|
|
|
this->Property->SetAmbient(0.3);
|
|
|
|
this->Property->SetAmbientColor(0.88,0.86,0.2);
|
|
|
|
this->Property->SetDiffuseColor(0.99,0.7,0.21);
|
|
|
|
this->Property->SetSpecularColor(0.99,0.98,0.83);
|
|
|
|
}
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
switch(myDisplayMode){
|
|
|
|
case 0://wireframe
|
|
|
|
myPreHighlightProp->SetRepresentationToWireframe();
|
|
|
|
myHighlightProp->SetRepresentationToWireframe();
|
|
|
|
break;
|
|
|
|
case 1://shading
|
|
|
|
myPreHighlightProp->SetRepresentationToSurface();
|
|
|
|
myHighlightProp->SetRepresentationToSurface();
|
|
|
|
break;
|
|
|
|
}
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
if(!myIsSelected){
|
|
|
|
if(myIsPreselected){
|
|
|
|
this->myHighlightActor->SetProperty(myPreHighlightProp.GetPointer());
|
|
|
|
myShadingFaceActor->SetProperty(myPreHighlightProp.GetPointer());
|
|
|
|
} else {
|
|
|
|
this->myHighlightActor->SetProperty(myShadingFaceProp.GetPointer());
|
|
|
|
myShadingFaceActor->SetProperty(myShadingFaceProp.GetPointer());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
this->myHighlightActor->SetProperty(myHighlightProp.GetPointer());
|
|
|
|
myShadingFaceActor->SetProperty(myHighlightProp.GetPointer());
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
this->Property->Render(this, ren);
|
|
|
|
if (this->BackfaceProperty) {
|
|
|
|
this->BackfaceProperty->BackfaceRender(this, ren);
|
|
|
|
this->Device->SetBackfaceProperty(this->BackfaceProperty);
|
|
|
|
}
|
|
|
|
this->Device->SetProperty(this->Property);
|
|
|
|
if(myShape.ShapeType() == TopAbs_VERTEX) {
|
|
|
|
if(ren){
|
|
|
|
//The parameter determine size of vertex actor relate to diagonal of RendererWindow
|
2006-05-06 14:44:32 +06:00
|
|
|
static vtkFloatingPointType delta = 0.01;
|
|
|
|
vtkFloatingPointType X1 = -1, Y1 = -1, Z1 = 0;
|
2003-05-12 21:09:12 +06:00
|
|
|
ren->ViewToWorld(X1,Y1,Z1);
|
2006-05-06 14:44:32 +06:00
|
|
|
vtkFloatingPointType X2 = +1, Y2 = +1, Z2 = 0;
|
2003-05-12 21:09:12 +06:00
|
|
|
ren->ViewToWorld(X2,Y2,Z2);
|
|
|
|
Z2 = sqrt((X2-X1)*(X2-X1) + (Y2-Y1)*(Y2-Y1) + (Z2-Z1)*(Z2-Z1));
|
|
|
|
this->SetScale(Z2*delta);
|
|
|
|
}
|
|
|
|
vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
|
|
|
|
this->GetMatrix(ren->GetActiveCamera(), aMatrix);
|
|
|
|
this->Device->SetUserMatrix(aMatrix);
|
2008-03-07 12:45:34 +05:00
|
|
|
this->Device->Render(ren,theMapper);
|
2003-05-12 21:09:12 +06:00
|
|
|
aMatrix->Delete();
|
|
|
|
} else
|
2008-03-07 12:45:34 +05:00
|
|
|
this->Device->Render(ren, theMapper);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void GEOM_Actor::ReleaseGraphicsResources(vtkWindow *)
|
|
|
|
{
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << "GEOM_Actor::ReleaseGraphicsResources"<<endl;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GEOM_Actor::ShallowCopy(vtkProp *prop)
|
|
|
|
{
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << "GEOM_Actor::ShallowCopy"<<endl;
|
|
|
|
#endif
|
|
|
|
GEOM_Actor *f = GEOM_Actor::SafeDownCast(prop);
|
|
|
|
if ( f != NULL )
|
|
|
|
{
|
|
|
|
this->SetShape(f->getTopo(),f->GetDeflection(),f->GetIsRelative());
|
|
|
|
}
|
|
|
|
|
|
|
|
// Now do superclass
|
|
|
|
this->SALOME_Actor::ShallowCopy(prop);
|
|
|
|
}
|
|
|
|
|
|
|
|
const TopoDS_Shape& GEOM_Actor::getTopo() {
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << "GEOM_Actor::getTopo"<<endl;
|
|
|
|
#endif
|
|
|
|
return myShape;
|
|
|
|
}
|
|
|
|
|
|
|
|
void GEOM_Actor::setInputShape(const TopoDS_Shape& ashape, double adef1,
|
|
|
|
int imode, bool isVector)
|
|
|
|
{
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << "GEOM_Actor::setInputShape"<<endl;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
double GEOM_Actor::getDeflection()
|
|
|
|
{
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << "GEOM_Actor::getDeflection"<<endl;
|
|
|
|
#endif
|
|
|
|
return (double) GetDeflection();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double GEOM_Actor::isVector()
|
|
|
|
{
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << "GEOM_Actor::isVector"<<endl;
|
|
|
|
#endif
|
|
|
|
return 0;
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
void GEOM_Actor::SubShapeOn()
|
|
|
|
{
|
2008-03-07 12:45:34 +05:00
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << "GEOM_Actor::SubShapeOn"<<endl;
|
|
|
|
#endif
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
2008-03-07 12:45:34 +05:00
|
|
|
|
2003-05-12 21:09:12 +06:00
|
|
|
void GEOM_Actor::SubShapeOff()
|
|
|
|
{
|
2008-03-07 12:45:34 +05:00
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << "GEOM_Actor::SubShapeOff"<<endl;
|
|
|
|
#endif
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
void GEOM_Actor::highlight(bool highlight)
|
|
|
|
{
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << this << " GEOM_Actor::highlight highlight="<<highlight<<endl;
|
|
|
|
#endif
|
|
|
|
SALOME_Actor::highlight(highlight);
|
|
|
|
}
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2006-05-06 14:44:32 +06:00
|
|
|
void GEOM_Actor::SetOpacity(vtkFloatingPointType opa)
|
2003-05-12 21:09:12 +06:00
|
|
|
{
|
2008-03-07 12:45:34 +05:00
|
|
|
// enk:tested OK
|
|
|
|
myShadingFaceProp->SetOpacity(opa);
|
|
|
|
myHighlightProp->SetOpacity(opa);
|
|
|
|
myPreHighlightProp->SetOpacity(opa);
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
vtkFloatingPointType GEOM_Actor::GetOpacity()
|
|
|
|
{
|
|
|
|
// enk:tested OK
|
|
|
|
return myShadingFaceProp->GetOpacity();
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
void GEOM_Actor::SetColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b)
|
|
|
|
{
|
|
|
|
// enk:tested OK
|
|
|
|
myShadingFaceProp->SetColor(r,g,b);
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
void GEOM_Actor::GetColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b)
|
|
|
|
{
|
|
|
|
// enk:tested OK
|
|
|
|
vtkFloatingPointType aRGB[3];
|
|
|
|
myShadingFaceProp->GetColor(aRGB);
|
|
|
|
r = aRGB[0];
|
|
|
|
g = aRGB[1];
|
|
|
|
b = aRGB[2];
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
bool GEOM_Actor::IsInfinite()
|
|
|
|
{
|
|
|
|
return (bool)(myShape.Infinite());
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
/*!
|
|
|
|
To map current selection to VTK representation
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
GEOM_Actor
|
|
|
|
::Highlight(bool theIsHighlight)
|
|
|
|
{
|
|
|
|
myIsSelected = theIsHighlight;
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << this << " GEOM_Actor::Highlight myIsSelected="<<myIsSelected<<endl;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
SALOME_Actor::Highlight(theIsHighlight); // this method call ::highlight(theIsHighlight) in the end
|
|
|
|
SetVisibility(GetVisibility());
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
/*!
|
|
|
|
To process prehighlight (called from SVTK_InteractorStyle)
|
|
|
|
*/
|
|
|
|
bool
|
|
|
|
GEOM_Actor
|
|
|
|
::PreHighlight(vtkInteractorStyle *theInteractorStyle,
|
|
|
|
SVTK_SelectionEvent* theSelectionEvent,
|
|
|
|
bool theIsHighlight)
|
2003-05-12 21:09:12 +06:00
|
|
|
{
|
2008-03-07 12:45:34 +05:00
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << this<<" GEOM_Actor::PreHighlight (3) theIsHighlight="<<theIsHighlight<<endl;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if ( !GetPickable() )
|
|
|
|
return false;
|
|
|
|
|
|
|
|
myPreHighlightActor->SetVisibility( false );
|
|
|
|
bool anIsPreselected = myIsPreselected;
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
Selection_Mode aSelectionMode = theSelectionEvent->mySelectionMode;
|
|
|
|
bool anIsChanged = (mySelectionMode != aSelectionMode);
|
|
|
|
|
|
|
|
if( !theIsHighlight ) {
|
|
|
|
SetPreSelected( false );
|
|
|
|
}else{
|
|
|
|
switch(aSelectionMode){
|
|
|
|
case ActorSelection :
|
|
|
|
{
|
|
|
|
if( !mySelector->IsSelected( myIO ) ) {
|
|
|
|
SetPreSelected( true );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2003-05-12 21:09:12 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
mySelectionMode = aSelectionMode;
|
|
|
|
anIsChanged |= (anIsPreselected != myIsPreselected);
|
|
|
|
|
|
|
|
SetVisibility(GetVisibility());
|
|
|
|
return anIsChanged;
|
2003-05-12 21:09:12 +06:00
|
|
|
}
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
/*!
|
|
|
|
To process highlight (called from SVTK_InteractorStyle)
|
|
|
|
*/
|
|
|
|
bool
|
|
|
|
GEOM_Actor
|
|
|
|
::Highlight(vtkInteractorStyle *theInteractorStyle,
|
|
|
|
SVTK_SelectionEvent* theSelectionEvent,
|
|
|
|
bool theIsHighlight)
|
|
|
|
{
|
|
|
|
// define the selection of object
|
|
|
|
#ifdef MYDEBUG
|
|
|
|
cout << endl << this << " GEOM_Actor::Highlight (3) myIsSelected="<<myIsSelected<<endl;
|
|
|
|
#endif
|
|
|
|
bool aRet = SALOME_Actor::Highlight(theInteractorStyle,theSelectionEvent,theIsHighlight);
|
|
|
|
SetSelected(theIsHighlight);
|
|
|
|
if(theIsHighlight)
|
|
|
|
SetPreSelected(false);
|
|
|
|
|
|
|
|
|
|
|
|
return aRet;
|
|
|
|
}
|
2003-05-12 21:09:12 +06:00
|
|
|
|
|
|
|
// Copy the follower's composite 4x4 matrix into the matrix provided.
|
|
|
|
void GEOM_Actor::GetMatrix(vtkCamera* theCam, vtkMatrix4x4 *result)
|
|
|
|
{
|
|
|
|
double *pos, *vup;
|
|
|
|
double Rx[3], Ry[3], Rz[3], p1[3];
|
|
|
|
vtkMatrix4x4 *matrix = vtkMatrix4x4::New();
|
|
|
|
int i;
|
|
|
|
double distance;
|
|
|
|
|
|
|
|
this->GetOrientation();
|
|
|
|
this->Transform->Push();
|
|
|
|
this->Transform->PostMultiply();
|
|
|
|
this->Transform->Identity();
|
|
|
|
|
|
|
|
// apply user defined matrix last if there is one
|
|
|
|
if (this->UserMatrix)
|
|
|
|
{
|
|
|
|
this->Transform->Concatenate(this->UserMatrix);
|
|
|
|
}
|
|
|
|
|
|
|
|
this->Transform->Translate(-this->Origin[0],
|
|
|
|
-this->Origin[1],
|
|
|
|
-this->Origin[2]);
|
|
|
|
// scale
|
|
|
|
this->Transform->Scale(this->Scale[0],
|
|
|
|
this->Scale[1],
|
|
|
|
this->Scale[2]);
|
|
|
|
|
|
|
|
// rotate
|
|
|
|
this->Transform->RotateY(this->Orientation[1]);
|
|
|
|
this->Transform->RotateX(this->Orientation[0]);
|
|
|
|
this->Transform->RotateZ(this->Orientation[2]);
|
|
|
|
|
|
|
|
if (theCam)
|
|
|
|
{
|
|
|
|
// do the rotation
|
|
|
|
// first rotate y
|
|
|
|
pos = theCam->GetPosition();
|
|
|
|
vup = theCam->GetViewUp();
|
|
|
|
|
|
|
|
if (theCam->GetParallelProjection())
|
|
|
|
{
|
|
|
|
theCam->GetDirectionOfProjection(Rz);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
distance = sqrt(
|
|
|
|
(pos[0] - this->Position[0])*(pos[0] - this->Position[0]) +
|
|
|
|
(pos[1] - this->Position[1])*(pos[1] - this->Position[1]) +
|
|
|
|
(pos[2] - this->Position[2])*(pos[2] - this->Position[2]));
|
|
|
|
for (i = 0; i < 3; i++)
|
|
|
|
{
|
|
|
|
Rz[i] = (pos[i] - this->Position[i])/distance;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
vtkMath::Cross(vup,Rz,Rx);
|
|
|
|
vtkMath::Normalize(Rx);
|
|
|
|
vtkMath::Cross(Rz,Rx,Ry);
|
|
|
|
|
|
|
|
matrix->Element[0][0] = Rx[0];
|
|
|
|
matrix->Element[1][0] = Rx[1];
|
|
|
|
matrix->Element[2][0] = Rx[2];
|
|
|
|
matrix->Element[0][1] = Ry[0];
|
|
|
|
matrix->Element[1][1] = Ry[1];
|
|
|
|
matrix->Element[2][1] = Ry[2];
|
|
|
|
matrix->Element[0][2] = Rz[0];
|
|
|
|
matrix->Element[1][2] = Rz[1];
|
|
|
|
matrix->Element[2][2] = Rz[2];
|
|
|
|
|
|
|
|
this->Transform->Concatenate(matrix);
|
|
|
|
}
|
|
|
|
|
|
|
|
// translate to projection reference point PRP
|
|
|
|
// this is the camera's position blasted through
|
|
|
|
// the current matrix
|
|
|
|
p1[0] = this->Origin[0] + this->Position[0];
|
|
|
|
p1[1] = this->Origin[1] + this->Position[1];
|
|
|
|
p1[2] = this->Origin[2] + this->Position[2];
|
|
|
|
|
|
|
|
this->Transform->Translate(p1[0],p1[1],p1[2]);
|
|
|
|
this->Transform->GetMatrix(result);
|
|
|
|
|
|
|
|
matrix->Delete();
|
|
|
|
this->Transform->Pop();
|
|
|
|
}
|