summaryrefslogtreecommitdiff
path: root/src/PrsMgr/PrsMgr_Prs.cxx
blob: b3a7201d5b27bd530ab210c1fc52184812c7560e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include <PrsMgr_Prs.ixx>
#include <PrsMgr_Presentation3d.hxx>
#include <Precision.hxx>
#include <gp_Trsf.hxx>
#include <Geom_Transformation.hxx>

PrsMgr_Prs::PrsMgr_Prs (const Handle(Graphic3d_StructureManager)& aStructureManager,
			const PrsMgr_Presentation3dPointer& aPresentation3d, 
			const PrsMgr_TypeOfPresentation3d aTypeOfPresentation)
:Prs3d_Presentation(aStructureManager),myPresentation3d(aPresentation3d) 
{
  
  if (aTypeOfPresentation == PrsMgr_TOP_ProjectorDependant)
    SetVisual(Graphic3d_TOS_COMPUTED);
}

//=======================================================================
//function : Compute
//purpose  : 
//=======================================================================

Handle(Graphic3d_Structure) PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector) {
  return myPresentation3d->Compute(aProjector);
}
//=======================================================================
//function : Compute
//purpose  : 
//=======================================================================

Handle(Graphic3d_Structure) PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector,
						const TColStd_Array2OfReal& AMatrix) 
{
  gp_Trsf TheTrsf;
  Standard_Integer LC(AMatrix.LowerCol()),LR(AMatrix.LowerRow());
  TheTrsf.SetValues(AMatrix(LR,LC),AMatrix(LR,LC+1),AMatrix(LR,LC+2),AMatrix(LR,LC+3),
		    AMatrix(LR+1,LC),AMatrix(LR+1,LC+1),AMatrix(LR+1,LC+2),AMatrix(LR+1,LC+3),
		    AMatrix(LR+2,LC),AMatrix(LR+2,LC+1),AMatrix(LR+2,LC+2),AMatrix(LR+2,LC+3),
		    Precision::Angular(),Precision::Confusion());
   Handle(Geom_Transformation) G = new Geom_Transformation(TheTrsf);
  
  return myPresentation3d->Compute(aProjector,G);
}

//=======================================================================
//function : Compute
//purpose  : 
//=======================================================================

void PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector,
			 Handle(Graphic3d_Structure)& aGivenStruct) 
{
  myPresentation3d->Compute(aProjector,aGivenStruct);
}


//=======================================================================
//function : Compute
//purpose  : 
//=======================================================================

void PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector,
			 const TColStd_Array2OfReal& AMatrix,
			  Handle(Graphic3d_Structure)& aGivenStruct) 
{
  gp_Trsf TheTrsf;
  Standard_Integer LC(AMatrix.LowerCol()),LR(AMatrix.LowerRow());
  TheTrsf.SetValues(AMatrix(LR,LC),AMatrix(LR,LC+1),AMatrix(LR,LC+2),AMatrix(LR,LC+3),
		    AMatrix(LR+1,LC),AMatrix(LR+1,LC+1),AMatrix(LR+1,LC+2),AMatrix(LR+1,LC+3),
		    AMatrix(LR+2,LC),AMatrix(LR+2,LC+1),AMatrix(LR+2,LC+2),AMatrix(LR+2,LC+3),
		    Precision::Angular(),Precision::Confusion());
  Handle(Geom_Transformation) G = new Geom_Transformation(TheTrsf);


  myPresentation3d->Compute(aProjector,G,aGivenStruct);
}