1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // GEOM OBJECT : interactive object for Geometry entities visualization
24 // File : GEOM_Actor.cxx
25 // Author : Christophe ATTANASIO
30 \class GEOM_Actor GEOM_Actor.h
31 \brief This class allows to display an OpenCASCADE CAD model in a VTK viewer.
33 #include "GEOM_Actor.h"
35 #include "GEOM_DeviceActor.h"
36 #include "GEOM_VertexSource.h"
37 #include "GEOM_EdgeSource.h"
38 #include "GEOM_WireframeFace.h"
39 #include "GEOM_ShadingFace.h"
40 #include "SVTK_Actor.h"
42 #include <OCC2VTK_Tools.h>
44 #include <vtkObjectFactory.h>
45 #include <vtkRenderer.h>
46 #include <vtkProperty.h>
47 #include <vtkPointPicker.h>
48 #include <vtkCellPicker.h>
50 #include <TopAbs_ShapeEnum.hxx>
51 #include <TopExp_Explorer.hxx>
53 #include <BRep_Tool.hxx>
56 #include <vtkPolyDataWriter.h>
58 #include <vtkAppendPolyData.h>
59 #include <vtkPolyDataMapper.h>
60 #include <vtkPolyData.h>
61 #include <vtkTransform.h>
62 #include <vtkMatrix4x4.h>
64 #include <vtkCamera.h>
66 #include "utilities.h"
68 #include "SALOME_InteractiveObject.hxx"
70 //vtkStandardNewMacro(GEOM_Actor);
76 GEOM_Actor::GEOM_Actor():
77 // myDisplayMode(eWireframe),
80 myVertexActor(GEOM_DeviceActor::New(),true),
81 myVertexSource(GEOM_VertexSource::New(),true),
83 myIsolatedEdgeActor(GEOM_DeviceActor::New(),true),
84 myIsolatedEdgeSource(GEOM_EdgeSource::New(),true),
86 myOneFaceEdgeActor(GEOM_DeviceActor::New(),true),
87 myOneFaceEdgeSource(GEOM_EdgeSource::New(),true),
89 mySharedEdgeActor(GEOM_DeviceActor::New(),true),
90 mySharedEdgeSource(GEOM_EdgeSource::New(),true),
92 myWireframeFaceActor(GEOM_DeviceActor::New(),true),
93 myWireframeFaceSource(GEOM_WireframeFace::New(),true),
95 myShadingFaceActor(GEOM_DeviceActor::New(),true),
96 myShadingFaceSource(GEOM_ShadingFace::New(),true),
98 myHighlightActor(GEOM_DeviceActor::New(),true),
99 myAppendFilter(vtkAppendPolyData::New(),true),
100 myPolyDataMapper(vtkPolyDataMapper::New(),true),
102 myHighlightProp(vtkProperty::New()),
103 myPreHighlightProp(vtkProperty::New()),
104 myShadingFaceProp(vtkProperty::New()),
108 MESSAGE (this<< " GEOM_Actor::GEOM_Actor");
111 myPolyDataMapper->SetInput(myAppendFilter->GetOutput());
112 vtkProperty* aProperty;
114 myHighlightProp->SetAmbient(0.5);
115 myHighlightProp->SetDiffuse(0.3);
116 myHighlightProp->SetSpecular(0.2);
117 myHighlightProp->SetRepresentationToSurface();
118 myHighlightProp->SetAmbientColor(1, 1, 1);
119 myHighlightProp->SetDiffuseColor(1, 1, 1);
120 myHighlightProp->SetSpecularColor(0.5, 0.5, 0.5);
121 myHighlightProp->SetPointSize(SALOME_POINT_SIZE);
122 myHighlightActor->SetProperty(myHighlightProp.GetPointer());
124 this->myHighlightActor->SetInput(myAppendFilter->GetOutput(),false);
126 myPreHighlightProp->SetColor(0,1,1);
127 myPreHighlightProp->SetPointSize(SALOME_POINT_SIZE+2);
128 myPreHighlightProp->SetLineWidth(SALOME_LINE_WIDTH+1);
129 myPreHighlightProp->SetRepresentationToWireframe();
131 myAppendFilter->AddInput(myVertexSource->GetOutput());
132 myVertexActor->SetInput(myVertexSource->GetOutput(),false);
133 aProperty = myVertexActor->GetProperty();
134 aProperty->SetRepresentation(VTK_POINTS);
135 aProperty->SetPointSize(3);
136 aProperty->SetColor(1, 1, 0);
138 myAppendFilter->AddInput(myIsolatedEdgeSource->GetOutput());
139 myIsolatedEdgeActor->SetInput(myIsolatedEdgeSource->GetOutput(),false);
140 aProperty = myIsolatedEdgeActor->GetProperty();
141 aProperty->SetRepresentation(VTK_WIREFRAME);
142 aProperty->SetColor(1, 0, 0);
144 myAppendFilter->AddInput(myOneFaceEdgeSource->GetOutput());
145 myOneFaceEdgeActor->SetInput(myOneFaceEdgeSource->GetOutput(),false);
146 aProperty = myOneFaceEdgeActor->GetProperty();
147 aProperty->SetRepresentation(VTK_WIREFRAME);
148 aProperty->SetColor(0, 1, 0);
150 myAppendFilter->AddInput(mySharedEdgeSource->GetOutput());
151 mySharedEdgeActor->SetInput(mySharedEdgeSource->GetOutput(),false);
152 aProperty = mySharedEdgeActor->GetProperty();
153 aProperty->SetRepresentation(VTK_WIREFRAME);
154 aProperty->SetColor(1, 1, 0);
156 myAppendFilter->AddInput(myWireframeFaceSource->GetOutput());
157 myWireframeFaceActor->SetInput(myWireframeFaceSource->GetOutput(),false);
158 aProperty = myWireframeFaceActor->GetProperty();
159 aProperty->SetRepresentation(VTK_WIREFRAME);
160 aProperty->SetColor(0.5, 0.5, 0.5);
162 myShadingFaceActor->SetInput(myShadingFaceSource->GetOutput(),true);
164 myShadingFaceProp->SetRepresentation(VTK_SURFACE);
165 myShadingFaceProp->SetInterpolationToGouraud();
166 myShadingFaceProp->SetAmbient(1.0);
167 myShadingFaceProp->SetDiffuse(1.0);
168 myShadingFaceProp->SetSpecular(0.4);
169 myShadingFaceProp->SetAmbientColor(0.329412, 0.223529, 0.027451);
170 myShadingFaceProp->SetDiffuseColor(0.780392, 0.568627, 0.113725);
171 myShadingFaceProp->SetSpecularColor(0.992157, 0.941176, 0.807843);
173 myShadingFaceActor->SetProperty(myShadingFaceProp.GetPointer());
175 // Toggle display mode
176 setDisplayMode(0); // WIRE FRAME
182 GEOM_Actor::~GEOM_Actor()
185 MESSAGE (this<< " ~GEOM_Actor::GEOM_Actor");
187 myHighlightProp->Delete();
188 myPreHighlightProp->Delete();
189 myShadingFaceProp->Delete();
196 GEOM_Actor* anObject = new GEOM_Actor();
197 anObject->SetMapper(anObject->myPolyDataMapper.Get());
202 void Write(vtkPolyData* theDataSet, const char* theFileName){
203 vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New();
204 MESSAGE ("Write - "<<theFileName<<"' : "<<theDataSet->GetNumberOfPoints()<<"; "<<theDataSet->GetNumberOfCells());
205 aWriter->SetInput(theDataSet);
206 aWriter->SetFileName(theFileName);
215 this->myVertexSource->Modified();
216 this->myIsolatedEdgeSource->Modified();
217 this->myOneFaceEdgeSource->Modified();
218 this->mySharedEdgeSource->Modified();
219 this->myWireframeFaceSource->Modified();
220 this->myShadingFaceSource->Modified();
225 SetMapper(vtkMapper* theMapper)
227 SALOME_Actor::SetMapper(theMapper);
232 AddToRender(vtkRenderer* theRenderer)
234 //SALOME_Actor::AddToRender(theRenderer);
236 theRenderer->AddActor(this);
238 this->myHighlightActor->AddToRender(theRenderer);
241 myShadingFaceActor->AddToRender(theRenderer);
242 myWireframeFaceActor->AddToRender(theRenderer);
244 mySharedEdgeActor->AddToRender(theRenderer);
245 myOneFaceEdgeActor->AddToRender(theRenderer);
246 myIsolatedEdgeActor->AddToRender(theRenderer);
248 myVertexActor->AddToRender(theRenderer);
253 RemoveFromRender(vtkRenderer* theRenderer)
255 //SALOME_Actor::RemoveFromRender(theRenderer);
258 theRenderer->RemoveActor(this);
260 myHighlightActor->RemoveFromRender(theRenderer);
261 myShadingFaceActor->RemoveFromRender(theRenderer);
262 myWireframeFaceActor->RemoveFromRender(theRenderer);
264 mySharedEdgeActor->RemoveFromRender(theRenderer);
265 myOneFaceEdgeActor->RemoveFromRender(theRenderer);
266 myIsolatedEdgeActor->RemoveFromRender(theRenderer);
268 myVertexActor->RemoveFromRender(theRenderer);
272 SetVisibility(false);
277 setDisplayMode(int theMode)
280 MESSAGE ( "GEOM_Actor::SetDisplayMode = "<<theMode );
282 VTKViewer_Actor::setDisplayMode(theMode);
283 SetVisibility(GetVisibility());
288 SetSelected(bool theIsSelected)
291 MESSAGE ( "GEOM_Actor::SetSelected = "<<theIsSelected );
294 myIsSelected = theIsSelected;
295 SetVisibility(GetVisibility());
300 SetVisibility(int theVisibility)
303 MESSAGE ( "GEOM_Actor::SetVisibility = "<<theVisibility <<" myIsSelected="<< myIsSelected
304 << " theVisibility="<<theVisibility<<" myIsPreselected="<<myIsPreselected );
307 SALOME_Actor::SetVisibility(theVisibility);
309 this->myHighlightActor->SetVisibility(theVisibility && (myIsSelected || myIsPreselected));
311 myShadingFaceActor->SetVisibility(theVisibility && (myDisplayMode == (int)eShading) && (!myIsSelected || !myIsPreselected));
312 myWireframeFaceActor->SetVisibility(theVisibility && (myDisplayMode ==(int)eWireframe) && !myIsSelected);
314 mySharedEdgeActor->SetVisibility(theVisibility && myDisplayMode == (int)eWireframe && !myIsSelected);
315 myOneFaceEdgeActor->SetVisibility(theVisibility && myDisplayMode == (int)eWireframe && !myIsSelected);
316 myIsolatedEdgeActor->SetVisibility(theVisibility && !myIsSelected);
318 myVertexActor->SetVisibility(theVisibility && !myIsSelected);// must be added new mode points
324 ::SetNbIsos(const int theNb[2])
326 myWireframeFaceSource->SetNbIso(theNb);
331 ::GetNbIsos(int &theNbU,int &theNbV)
333 myWireframeFaceSource->GetNbIso(theNbU, theNbV);
338 ::SetVectorMode(bool theMode)
340 myVectorMode = theMode;
341 myIsolatedEdgeSource->SetVectorMode(theMode);
342 myOneFaceEdgeSource->SetVectorMode(theMode);
343 mySharedEdgeSource->SetVectorMode(theMode);
356 SetDeflection(float theDeflection)
358 if( myDeflection == theDeflection )
361 myDeflection = theDeflection;
363 GEOM::MeshShape(myShape,myDeflection);
368 void GEOM_Actor::SetShape (const TopoDS_Shape& theShape,
374 myVertexSource->Clear();
375 myIsolatedEdgeSource->Clear();
376 myOneFaceEdgeSource->Clear();
377 mySharedEdgeSource->Clear();
378 myWireframeFaceSource->Clear();
379 myShadingFaceSource->Clear();
381 TopExp_Explorer aVertexExp (theShape,TopAbs_VERTEX);
382 for (; aVertexExp.More(); aVertexExp.Next())
384 const TopoDS_Vertex& aVertex = TopoDS::Vertex(aVertexExp.Current());
385 myVertexSource->AddVertex(aVertex);
388 SetDeflection(theDeflection);
390 // look if edges are free or shared
391 TopTools_IndexedDataMapOfShapeListOfShape anEdgeMap;
392 TopExp::MapShapesAndAncestors(theShape,TopAbs_EDGE,TopAbs_FACE,anEdgeMap);
394 GEOM::SetShape(theShape,anEdgeMap,theIsVector,
395 myIsolatedEdgeSource.Get(),
396 myOneFaceEdgeSource.Get(),
397 mySharedEdgeSource.Get(),
398 myWireframeFaceSource.Get(),
399 myShadingFaceSource.Get());
401 myIsolatedEdgeSource->IsEmpty() &&
402 myOneFaceEdgeSource->IsEmpty() &&
403 mySharedEdgeSource->IsEmpty() &&
404 myWireframeFaceSource->IsEmpty() &&
405 myShadingFaceSource->IsEmpty();
408 if((bool)myShape.Infinite() || isOnlyVertex ){
409 myVertexActor->GetDeviceActor()->SetInfinitive(true);
410 myHighlightActor->GetDeviceActor()->SetInfinitive(true);
415 void GEOM_Actor::setDeflection(double adef) {
417 MESSAGE ( "GEOM_Actor::setDeflection" );
419 SetDeflection((float)adef);
423 // warning! must be checked!
424 // SetHighlightProperty
425 // SetWireframeProperty
426 // SetShadingProperty
428 void GEOM_Actor::SetHighlightProperty(vtkProperty* Prop)
431 MESSAGE ( "GEOM_Actor::SetHighlightProperty" );
433 this->myHighlightActor->GetProperty()->DeepCopy(Prop);
437 void GEOM_Actor::SetWireframeProperty(vtkProperty* Prop)
440 MESSAGE ( this << " GEOM_Actor::SetWireframeProperty" );
443 myWireframeFaceActor->SetProperty(Prop);
446 void GEOM_Actor::SetShadingProperty(vtkProperty* Prop)
449 MESSAGE ( "GEOM_Actor::SetShadingProperty" );
451 myShadingFaceProp->DeepCopy(Prop);
455 void GEOM_Actor::Render(vtkRenderer *ren, vtkMapper *theMapper)
458 MESSAGE ( "GEOM_Actor::Render" );
464 /* render the property */
465 if (!this->Property) {
466 // force creation of a property
468 this->Property->SetInterpolation(1);
469 this->Property->SetRepresentationToSurface();
470 this->Property->SetAmbient(0.3);
471 this->Property->SetAmbientColor(0.88,0.86,0.2);
472 this->Property->SetDiffuseColor(0.99,0.7,0.21);
473 this->Property->SetSpecularColor(0.99,0.98,0.83);
476 switch(myDisplayMode){
478 myPreHighlightProp->SetRepresentationToWireframe();
479 myHighlightProp->SetRepresentationToWireframe();
482 myPreHighlightProp->SetRepresentationToSurface();
483 myHighlightProp->SetRepresentationToSurface();
489 this->myHighlightActor->SetProperty(myPreHighlightProp.GetPointer());
490 myShadingFaceActor->SetProperty(myPreHighlightProp.GetPointer());
492 this->myHighlightActor->SetProperty(myShadingFaceProp.GetPointer());
493 myShadingFaceActor->SetProperty(myShadingFaceProp.GetPointer());
497 this->myHighlightActor->SetProperty(myHighlightProp.GetPointer());
498 myShadingFaceActor->SetProperty(myHighlightProp.GetPointer());
501 this->Property->Render(this, ren);
502 if (this->BackfaceProperty) {
503 this->BackfaceProperty->BackfaceRender(this, ren);
504 this->Device->SetBackfaceProperty(this->BackfaceProperty);
506 this->Device->SetProperty(this->Property);
507 /* if(myShape.ShapeType() == TopAbs_VERTEX) {
509 //The parameter determine size of vertex actor relate to diagonal of RendererWindow
510 static vtkFloatingPointType delta = 0.01;
511 vtkFloatingPointType X1 = -1, Y1 = -1, Z1 = 0;
512 ren->ViewToWorld(X1,Y1,Z1);
513 vtkFloatingPointType X2 = +1, Y2 = +1, Z2 = 0;
514 ren->ViewToWorld(X2,Y2,Z2);
515 Z2 = sqrt((X2-X1)*(X2-X1) + (Y2-Y1)*(Y2-Y1) + (Z2-Z1)*(Z2-Z1));
516 this->SetScale(Z2*delta);
518 vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
519 this->GetMatrix(ren->GetActiveCamera(), aMatrix);
520 this->Device->SetUserMatrix(aMatrix);
521 this->Device->Render(ren,theMapper);
524 this->Device->Render(ren, theMapper);
527 void GEOM_Actor::ReleaseGraphicsResources(vtkWindow *)
530 MESSAGE ( "GEOM_Actor::ReleaseGraphicsResources" );
536 void GEOM_Actor::ShallowCopy(vtkProp *prop)
539 MESSAGE ( "GEOM_Actor::ShallowCopy" );
541 GEOM_Actor *f = GEOM_Actor::SafeDownCast(prop);
544 this->SetShape(f->getTopo(),f->GetDeflection());
548 this->SALOME_Actor::ShallowCopy(prop);
551 const TopoDS_Shape& GEOM_Actor::getTopo() {
553 MESSAGE ( "GEOM_Actor::getTopo" );
558 void GEOM_Actor::setInputShape(const TopoDS_Shape& ashape, double adef1,
559 int imode, bool isVector)
562 MESSAGE ( "GEOM_Actor::setInputShape" );
566 double GEOM_Actor::getDeflection()
569 MESSAGE ( "GEOM_Actor::getDeflection" );
571 return (double) GetDeflection();
575 double GEOM_Actor::isVector()
578 MESSAGE ( "GEOM_Actor::isVector" );
583 void GEOM_Actor::SubShapeOn()
586 MESSAGE ( "GEOM_Actor::SubShapeOn" );
590 void GEOM_Actor::SubShapeOff()
593 MESSAGE ( "GEOM_Actor::SubShapeOff" );
597 void GEOM_Actor::highlight(bool highlight)
600 MESSAGE ( this << " GEOM_Actor::highlight highlight="<<highlight );
602 SALOME_Actor::highlight(highlight);
605 void GEOM_Actor::SetOpacity(vtkFloatingPointType opa)
608 myShadingFaceProp->SetOpacity(opa);
609 myHighlightProp->SetOpacity(opa);
610 myPreHighlightProp->SetOpacity(opa);
611 myVertexActor->GetProperty()->SetOpacity(opa);
614 vtkFloatingPointType GEOM_Actor::GetOpacity()
617 return myShadingFaceProp->GetOpacity();
620 void GEOM_Actor::SetColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b)
623 myShadingFaceProp->SetColor(r,g,b); // shading color (Shading)
624 myIsolatedEdgeActor->GetProperty()->SetColor(r,g,b); // standalone edge color (Wireframe)
625 myVertexActor->GetProperty()->SetColor(r,g,b); // vertex actor (Shading/Wireframe)
626 myOneFaceEdgeActor->GetProperty()->SetColor(r,g,b); // standalone face edge color (Wireframe)
627 mySharedEdgeActor->GetProperty()->SetColor(r,g,b); // share edge color (Wireframe)
630 void GEOM_Actor::GetColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b)
633 vtkFloatingPointType aRGB[3];
634 myShadingFaceProp->GetColor(aRGB);
640 bool GEOM_Actor::IsInfinitive()
642 return ((bool)myShape.Infinite() || isOnlyVertex);
646 To map current selection to VTK representation
650 ::Highlight(bool theIsHighlight)
652 myIsSelected = theIsHighlight;
654 MESSAGE ( this << " GEOM_Actor::Highlight myIsSelected="<<myIsSelected );
657 SALOME_Actor::Highlight(theIsHighlight); // this method call ::highlight(theIsHighlight) in the end
658 SetVisibility(GetVisibility());
662 To process prehighlight (called from SVTK_InteractorStyle)
666 ::PreHighlight(vtkInteractorStyle *theInteractorStyle,
667 SVTK_SelectionEvent* theSelectionEvent,
671 MESSAGE ( this<<" GEOM_Actor::PreHighlight (3) theIsHighlight="<<theIsHighlight );
674 if ( !GetPickable() )
677 myPreHighlightActor->SetVisibility( false );
678 bool anIsPreselected = myIsPreselected;
680 Selection_Mode aSelectionMode = theSelectionEvent->mySelectionMode;
681 bool anIsChanged = (mySelectionMode != aSelectionMode);
683 if( !theIsHighlight ) {
684 SetPreSelected( false );
686 switch(aSelectionMode){
687 case ActorSelection :
689 // cout << "=============== " << myIO->getEntry() << endl;
690 // int nbio = mySelector->IObjectCount();
691 // cout << " nbio = " << nbio << endl;
693 if( !mySelector->IsSelected( myIO ) ) {
694 // printf ("!!!!!!!!!!!!!!!!\n");
695 SetPreSelected( true );
703 mySelectionMode = aSelectionMode;
704 anIsChanged |= (anIsPreselected != myIsPreselected);
706 SetVisibility(GetVisibility());
711 To process highlight (called from SVTK_InteractorStyle)
715 ::Highlight(vtkInteractorStyle *theInteractorStyle,
716 SVTK_SelectionEvent* theSelectionEvent,
719 // define the selection of object
721 MESSAGE ( std::endl << this << " GEOM_Actor::Highlight (3) myIsSelected="<<myIsSelected );
723 bool aRet = SALOME_Actor::Highlight(theInteractorStyle,theSelectionEvent,theIsHighlight);
724 SetSelected(theIsHighlight);
726 SetPreSelected(false);
732 // Copy the follower's composite 4x4 matrix into the matrix provided.
733 void GEOM_Actor::GetMatrix(vtkCamera* theCam, vtkMatrix4x4 *result)
736 double Rx[3], Ry[3], Rz[3], p1[3];
737 vtkMatrix4x4 *matrix = vtkMatrix4x4::New();
741 this->GetOrientation();
742 this->Transform->Push();
743 this->Transform->PostMultiply();
744 this->Transform->Identity();
746 // apply user defined matrix last if there is one
747 if (this->UserMatrix)
749 this->Transform->Concatenate(this->UserMatrix);
752 this->Transform->Translate(-this->Origin[0],
756 this->Transform->Scale(this->Scale[0],
761 this->Transform->RotateY(this->Orientation[1]);
762 this->Transform->RotateX(this->Orientation[0]);
763 this->Transform->RotateZ(this->Orientation[2]);
769 pos = theCam->GetPosition();
770 vup = theCam->GetViewUp();
772 if (theCam->GetParallelProjection())
774 theCam->GetDirectionOfProjection(Rz);
779 (pos[0] - this->Position[0])*(pos[0] - this->Position[0]) +
780 (pos[1] - this->Position[1])*(pos[1] - this->Position[1]) +
781 (pos[2] - this->Position[2])*(pos[2] - this->Position[2]));
782 for (i = 0; i < 3; i++)
784 Rz[i] = (pos[i] - this->Position[i])/distance;
788 vtkMath::Cross(vup,Rz,Rx);
789 vtkMath::Normalize(Rx);
790 vtkMath::Cross(Rz,Rx,Ry);
792 matrix->Element[0][0] = Rx[0];
793 matrix->Element[1][0] = Rx[1];
794 matrix->Element[2][0] = Rx[2];
795 matrix->Element[0][1] = Ry[0];
796 matrix->Element[1][1] = Ry[1];
797 matrix->Element[2][1] = Ry[2];
798 matrix->Element[0][2] = Rz[0];
799 matrix->Element[1][2] = Rz[1];
800 matrix->Element[2][2] = Rz[2];
802 this->Transform->Concatenate(matrix);
805 // translate to projection reference point PRP
806 // this is the camera's position blasted through
807 // the current matrix
808 p1[0] = this->Origin[0] + this->Position[0];
809 p1[1] = this->Origin[1] + this->Position[1];
810 p1[2] = this->Origin[2] + this->Position[2];
812 this->Transform->Translate(p1[0],p1[1],p1[2]);
813 this->Transform->GetMatrix(result);
816 this->Transform->Pop();