b311480e |
1 | // Copyright (c) 1998-1999 Matra Datavision |
973c2be1 |
2 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
3 | // |
973c2be1 |
4 | // This file is part of Open CASCADE Technology software library. |
b311480e |
5 | // |
d5f74e42 |
6 | // This library is free software; you can redistribute it and/or modify it under |
7 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
8 | // by the Free Software Foundation, with special exception defined in the file |
9 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
10 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
11 | // |
973c2be1 |
12 | // Alternatively, this file may be used under the terms of Open CASCADE |
13 | // commercial license or contractual agreement. |
b311480e |
14 | |
42cf5bc1 |
15 | |
7fd59977 |
16 | #include <Geom_Transformation.hxx> |
42cf5bc1 |
17 | #include <gp_Trsf.hxx> |
18 | #include <Graphic3d_DataStructureManager.hxx> |
19 | #include <Graphic3d_Structure.hxx> |
20 | #include <Graphic3d_StructureManager.hxx> |
21 | #include <Precision.hxx> |
22 | #include <PrsMgr_Presentation.hxx> |
23 | #include <PrsMgr_Prs.hxx> |
24 | #include <Standard_Type.hxx> |
7fd59977 |
25 | |
92efcf78 |
26 | IMPLEMENT_STANDARD_RTTIEXT(PrsMgr_Prs,Prs3d_Presentation) |
27 | |
af324faa |
28 | PrsMgr_Prs::PrsMgr_Prs (const Handle(Graphic3d_StructureManager)& theStructManager, |
29 | const PrsMgr_PresentationPointer& thePrs, |
30 | const PrsMgr_TypeOfPresentation3d theTypeOfPresentation) |
31 | : Prs3d_Presentation (theStructManager), |
32 | myPresentation3d (thePrs) |
7fd59977 |
33 | { |
af324faa |
34 | if (theTypeOfPresentation == PrsMgr_TOP_ProjectorDependant) |
7fd59977 |
35 | SetVisual(Graphic3d_TOS_COMPUTED); |
36 | } |
37 | |
38 | //======================================================================= |
39 | //function : Compute |
40 | //purpose : |
41 | //======================================================================= |
42 | |
eb4320f2 |
43 | void PrsMgr_Prs::Compute() |
44 | { |
45 | myPresentation3d->Compute (this); |
46 | } |
47 | |
48 | //======================================================================= |
49 | //function : Compute |
50 | //purpose : |
51 | //======================================================================= |
52 | |
7fd59977 |
53 | Handle(Graphic3d_Structure) PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector) { |
54 | return myPresentation3d->Compute(aProjector); |
55 | } |
56 | //======================================================================= |
57 | //function : Compute |
58 | //purpose : |
59 | //======================================================================= |
60 | |
61 | Handle(Graphic3d_Structure) PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector, |
62 | const TColStd_Array2OfReal& AMatrix) |
63 | { |
64 | gp_Trsf TheTrsf; |
65 | Standard_Integer LC(AMatrix.LowerCol()),LR(AMatrix.LowerRow()); |
66 | TheTrsf.SetValues(AMatrix(LR,LC),AMatrix(LR,LC+1),AMatrix(LR,LC+2),AMatrix(LR,LC+3), |
67 | AMatrix(LR+1,LC),AMatrix(LR+1,LC+1),AMatrix(LR+1,LC+2),AMatrix(LR+1,LC+3), |
7a8c6a36 |
68 | AMatrix(LR+2,LC),AMatrix(LR+2,LC+1),AMatrix(LR+2,LC+2),AMatrix(LR+2,LC+3)); |
7fd59977 |
69 | Handle(Geom_Transformation) G = new Geom_Transformation(TheTrsf); |
70 | |
71 | return myPresentation3d->Compute(aProjector,G); |
72 | } |
73 | |
74 | //======================================================================= |
75 | //function : Compute |
76 | //purpose : |
77 | //======================================================================= |
78 | |
79 | void PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector, |
80 | Handle(Graphic3d_Structure)& aGivenStruct) |
81 | { |
82 | myPresentation3d->Compute(aProjector,aGivenStruct); |
83 | } |
84 | |
85 | |
86 | //======================================================================= |
87 | //function : Compute |
88 | //purpose : |
89 | //======================================================================= |
90 | |
91 | void PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector, |
92 | const TColStd_Array2OfReal& AMatrix, |
93 | Handle(Graphic3d_Structure)& aGivenStruct) |
94 | { |
95 | gp_Trsf TheTrsf; |
96 | Standard_Integer LC(AMatrix.LowerCol()),LR(AMatrix.LowerRow()); |
97 | TheTrsf.SetValues(AMatrix(LR,LC),AMatrix(LR,LC+1),AMatrix(LR,LC+2),AMatrix(LR,LC+3), |
98 | AMatrix(LR+1,LC),AMatrix(LR+1,LC+1),AMatrix(LR+1,LC+2),AMatrix(LR+1,LC+3), |
7a8c6a36 |
99 | AMatrix(LR+2,LC),AMatrix(LR+2,LC+1),AMatrix(LR+2,LC+2),AMatrix(LR+2,LC+3)); |
7fd59977 |
100 | Handle(Geom_Transformation) G = new Geom_Transformation(TheTrsf); |
101 | |
102 | |
103 | myPresentation3d->Compute(aProjector,G,aGivenStruct); |
104 | } |