1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 //--------------------------------------------------------------------
17 //--------------------------------------------------------------------
19 #include <gp_GTrsf.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>
30 IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_NetworkSubfigure,IGESData_IGESEntity)
32 IGESDraw_NetworkSubfigure::IGESDraw_NetworkSubfigure () { }
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)
43 if (!allConnectPoints.IsNull())
44 if (allConnectPoints->Lower() != 1)
45 throw Standard_DimensionMismatch("IGESDraw_NetworkSubfigure : Init");
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);
56 Handle(IGESDraw_NetworkSubfigureDef)
57 IGESDraw_NetworkSubfigure::SubfigureDefinition () const
59 return theSubfigureDefinition;
62 gp_XYZ IGESDraw_NetworkSubfigure::Translation () const
64 return theTranslation;
67 gp_XYZ IGESDraw_NetworkSubfigure::TransformedTranslation () const
69 gp_XYZ TempXYZ = theTranslation;
70 if (HasTransf()) Location().Transforms(TempXYZ);
74 gp_XYZ IGESDraw_NetworkSubfigure::ScaleFactors () const
76 return theScaleFactor;
79 Standard_Integer IGESDraw_NetworkSubfigure::TypeFlag () const
84 Handle(TCollection_HAsciiString) IGESDraw_NetworkSubfigure::ReferenceDesignator
90 Standard_Boolean IGESDraw_NetworkSubfigure::HasDesignatorTemplate () const
92 return (! theDesignatorTemplate.IsNull() );
95 Handle(IGESGraph_TextDisplayTemplate)
96 IGESDraw_NetworkSubfigure::DesignatorTemplate () const
98 return theDesignatorTemplate;
101 Standard_Integer IGESDraw_NetworkSubfigure::NbConnectPoints () const
103 return (theConnectPoints.IsNull() ? 0 : theConnectPoints->Length() );
106 Handle(IGESDraw_ConnectPoint) IGESDraw_NetworkSubfigure::ConnectPoint
107 (const Standard_Integer Index) const
109 return ( theConnectPoints->Value(Index) );