b311480e |
1 | // Created by: CKY / Contract Toubro-Larsen |
2 | // Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
3 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
7fd59977 |
6 | // |
d5f74e42 |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
7fd59977 |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
16 | //-------------------------------------------------------------------- |
7fd59977 |
17 | //-------------------------------------------------------------------- |
18 | |
7fd59977 |
19 | #include <gp_GTrsf.hxx> |
42cf5bc1 |
20 | #include <gp_XYZ.hxx> |
21 | #include <IGESDraw_ConnectPoint.hxx> |
22 | #include <IGESDraw_NetworkSubfigure.hxx> |
23 | #include <IGESDraw_NetworkSubfigureDef.hxx> |
24 | #include <IGESGraph_TextDisplayTemplate.hxx> |
25 | #include <Standard_DimensionMismatch.hxx> |
26 | #include <Standard_OutOfRange.hxx> |
27 | #include <Standard_Type.hxx> |
28 | #include <TCollection_HAsciiString.hxx> |
7fd59977 |
29 | |
92efcf78 |
30 | IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_NetworkSubfigure,IGESData_IGESEntity) |
31 | |
b311480e |
32 | IGESDraw_NetworkSubfigure::IGESDraw_NetworkSubfigure () { } |
7fd59977 |
33 | |
34 | void IGESDraw_NetworkSubfigure::Init |
35 | (const Handle(IGESDraw_NetworkSubfigureDef)& aDefinition, |
36 | const gp_XYZ& aTranslation, |
37 | const gp_XYZ& aScaleFactor, |
38 | const Standard_Integer aTypeFlag, |
39 | const Handle(TCollection_HAsciiString)& aDesignator, |
40 | const Handle(IGESGraph_TextDisplayTemplate)& aTemplate, |
41 | const Handle(IGESDraw_HArray1OfConnectPoint)& allConnectPoints) |
42 | { |
43 | if (!allConnectPoints.IsNull()) |
44 | if (allConnectPoints->Lower() != 1) |
9775fa61 |
45 | throw Standard_DimensionMismatch("IGESDraw_NetworkSubfigure : Init"); |
7fd59977 |
46 | theSubfigureDefinition = aDefinition; |
47 | theTranslation = aTranslation; |
48 | theScaleFactor = aScaleFactor; |
49 | theTypeFlag = aTypeFlag; |
50 | theDesignator = aDesignator; |
51 | theDesignatorTemplate = aTemplate; |
52 | theConnectPoints = allConnectPoints; |
53 | InitTypeAndForm(420,0); |
54 | } |
55 | |
56 | Handle(IGESDraw_NetworkSubfigureDef) |
57 | IGESDraw_NetworkSubfigure::SubfigureDefinition () const |
58 | { |
59 | return theSubfigureDefinition; |
60 | } |
61 | |
62 | gp_XYZ IGESDraw_NetworkSubfigure::Translation () const |
63 | { |
64 | return theTranslation; |
65 | } |
66 | |
67 | gp_XYZ IGESDraw_NetworkSubfigure::TransformedTranslation () const |
68 | { |
69 | gp_XYZ TempXYZ = theTranslation; |
70 | if (HasTransf()) Location().Transforms(TempXYZ); |
71 | return ( TempXYZ ); |
72 | } |
73 | |
74 | gp_XYZ IGESDraw_NetworkSubfigure::ScaleFactors () const |
75 | { |
76 | return theScaleFactor; |
77 | } |
78 | |
79 | Standard_Integer IGESDraw_NetworkSubfigure::TypeFlag () const |
80 | { |
81 | return theTypeFlag; |
82 | } |
83 | |
84 | Handle(TCollection_HAsciiString) IGESDraw_NetworkSubfigure::ReferenceDesignator |
85 | () const |
86 | { |
87 | return theDesignator; |
88 | } |
89 | |
90 | Standard_Boolean IGESDraw_NetworkSubfigure::HasDesignatorTemplate () const |
91 | { |
92 | return (! theDesignatorTemplate.IsNull() ); |
93 | } |
94 | |
95 | Handle(IGESGraph_TextDisplayTemplate) |
96 | IGESDraw_NetworkSubfigure::DesignatorTemplate () const |
97 | { |
98 | return theDesignatorTemplate; |
99 | } |
100 | |
101 | Standard_Integer IGESDraw_NetworkSubfigure::NbConnectPoints () const |
102 | { |
103 | return (theConnectPoints.IsNull() ? 0 : theConnectPoints->Length() ); |
104 | } |
105 | |
106 | Handle(IGESDraw_ConnectPoint) IGESDraw_NetworkSubfigure::ConnectPoint |
107 | (const Standard_Integer Index) const |
108 | { |
109 | return ( theConnectPoints->Value(Index) ); |
110 | } |