42cf5bc1 |
1 | // Created on: 1997-04-28 |
2 | // Created by: Christian CAILLET |
3 | // Copyright (c) 1997-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _StepToTopoDS_MakeTransformed_HeaderFile |
18 | #define _StepToTopoDS_MakeTransformed_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <gp_Trsf.hxx> |
25 | #include <StepToTopoDS_Root.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | class StepGeom_Axis2Placement3d; |
28 | class StepGeom_CartesianTransformationOperator3d; |
29 | class gp_Trsf; |
30 | class TopoDS_Shape; |
31 | class StepRepr_MappedItem; |
32 | class Transfer_TransientProcess; |
33 | |
34 | |
35 | //! Produces instances by Transformation of a basic item |
36 | class StepToTopoDS_MakeTransformed : public StepToTopoDS_Root |
37 | { |
38 | public: |
39 | |
40 | DEFINE_STANDARD_ALLOC |
41 | |
42 | |
43 | Standard_EXPORT StepToTopoDS_MakeTransformed(); |
44 | |
45 | //! Computes a transformation to pass from an Origin placement to |
46 | //! a Target placement. Returns True when done |
47 | //! If not done, the transformation will by Identity |
48 | Standard_EXPORT Standard_Boolean Compute (const Handle(StepGeom_Axis2Placement3d)& Origin, const Handle(StepGeom_Axis2Placement3d)& Target); |
49 | |
50 | //! Computes a transformation defined by an operator 3D |
51 | Standard_EXPORT Standard_Boolean Compute (const Handle(StepGeom_CartesianTransformationOperator3d)& Operator); |
52 | |
53 | //! Returns the computed transformation (Identity if not yet or |
54 | //! if failed) |
55 | Standard_EXPORT const gp_Trsf& Transformation() const; |
56 | |
57 | //! Applies the computed transformation to a shape |
58 | //! Returns False if the transformation is Identity |
59 | Standard_EXPORT Standard_Boolean Transform (TopoDS_Shape& shape) const; |
60 | |
61 | //! Translates a MappedItem. More precisely |
62 | //! A MappedItem has a MappingSource and a MappingTarget |
63 | //! MappingSource has a MappedRepresentation and a MappingOrigin |
64 | //! MappedRepresentation is the basic item to be instanced |
65 | //! MappingOrigin is the starting placement |
66 | //! MappingTarget is the final placement |
67 | //! |
68 | //! Hence, the transformation from MappingOrigin and MappingTarget |
69 | //! is computed, the MappedRepr. is converted to a Shape, then |
70 | //! transformed as an instance of this Shape |
71 | Standard_EXPORT TopoDS_Shape TranslateMappedItem (const Handle(StepRepr_MappedItem)& mapit, const Handle(Transfer_TransientProcess)& TP); |
72 | |
73 | |
74 | |
75 | |
76 | protected: |
77 | |
78 | |
79 | |
80 | |
81 | |
82 | private: |
83 | |
84 | |
85 | |
86 | gp_Trsf theTrsf; |
87 | |
88 | |
89 | }; |
90 | |
91 | |
92 | |
93 | |
94 | |
95 | |
96 | |
97 | #endif // _StepToTopoDS_MakeTransformed_HeaderFile |