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 <IGESDraw_NetworkSubfigureDef.ixx>
20 #include <Standard_DimensionMismatch.hxx>
23 IGESDraw_NetworkSubfigureDef::IGESDraw_NetworkSubfigureDef () { }
26 void IGESDraw_NetworkSubfigureDef::Init
27 (const Standard_Integer aDepth,
28 const Handle(TCollection_HAsciiString)& aName,
29 const Handle(IGESData_HArray1OfIGESEntity)& allEntities,
30 const Standard_Integer aTypeFlag,
31 const Handle(TCollection_HAsciiString)& aDesignator,
32 const Handle(IGESGraph_TextDisplayTemplate)& aTemplate,
33 const Handle(IGESDraw_HArray1OfConnectPoint)& allPointEntities)
35 if (!allPointEntities.IsNull())
36 if (allPointEntities->Lower() != 1 || allEntities->Lower() != 1)
37 Standard_DimensionMismatch::Raise("IGESDraw_NetworkSubfigureDef : Init");
40 theEntities = allEntities;
41 theTypeFlag = aTypeFlag;
42 theDesignator = aDesignator;
43 theDesignatorTemplate = aTemplate;
44 thePointEntities = allPointEntities;
45 InitTypeAndForm(320,0);
48 Standard_Integer IGESDraw_NetworkSubfigureDef::Depth () const
53 Handle(TCollection_HAsciiString) IGESDraw_NetworkSubfigureDef::Name () const
58 Standard_Integer IGESDraw_NetworkSubfigureDef::NbEntities () const
60 return theEntities->Length();
63 Handle(IGESData_IGESEntity) IGESDraw_NetworkSubfigureDef::Entity
64 (const Standard_Integer Index) const
66 return theEntities->Value(Index);
67 // if Index is out of bound HArray1 will raise OutOfRange exception
70 Standard_Integer IGESDraw_NetworkSubfigureDef::TypeFlag () const
75 Handle(TCollection_HAsciiString) IGESDraw_NetworkSubfigureDef::Designator
81 Standard_Boolean IGESDraw_NetworkSubfigureDef::HasDesignatorTemplate () const
83 return (! theDesignatorTemplate.IsNull());
86 Handle(IGESGraph_TextDisplayTemplate)
87 IGESDraw_NetworkSubfigureDef::DesignatorTemplate () const
89 return theDesignatorTemplate;
92 Standard_Integer IGESDraw_NetworkSubfigureDef::NbPointEntities () const
94 return (thePointEntities.IsNull() ? 0 : thePointEntities->Length());
97 Standard_Boolean IGESDraw_NetworkSubfigureDef::HasPointEntity
98 (const Standard_Integer Index) const
100 if (thePointEntities.IsNull()) return Standard_False;
101 return (! thePointEntities->Value(Index).IsNull());
102 // if Index is out of bound HArray1 will raise OutOfRange exception
105 Handle(IGESDraw_ConnectPoint) IGESDraw_NetworkSubfigureDef::PointEntity
106 (const Standard_Integer Index) const
108 return thePointEntities->Value(Index);
109 // if Index is out of bound HArray1 will raise OutOfRange exception