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 <IGESData_IGESEntity.hxx>
20 #include <IGESDraw_ConnectPoint.hxx>
21 #include <IGESDraw_NetworkSubfigureDef.hxx>
22 #include <IGESGraph_TextDisplayTemplate.hxx>
23 #include <Standard_DimensionMismatch.hxx>
24 #include <Standard_OutOfRange.hxx>
25 #include <Standard_Type.hxx>
26 #include <TCollection_HAsciiString.hxx>
28 IMPLEMENT_STANDARD_RTTIEXT(IGESDraw_NetworkSubfigureDef,IGESData_IGESEntity)
30 IGESDraw_NetworkSubfigureDef::IGESDraw_NetworkSubfigureDef () { }
33 void IGESDraw_NetworkSubfigureDef::Init
34 (const Standard_Integer aDepth,
35 const Handle(TCollection_HAsciiString)& aName,
36 const Handle(IGESData_HArray1OfIGESEntity)& allEntities,
37 const Standard_Integer aTypeFlag,
38 const Handle(TCollection_HAsciiString)& aDesignator,
39 const Handle(IGESGraph_TextDisplayTemplate)& aTemplate,
40 const Handle(IGESDraw_HArray1OfConnectPoint)& allPointEntities)
42 if (!allPointEntities.IsNull())
43 if (allPointEntities->Lower() != 1 || allEntities->Lower() != 1)
44 throw Standard_DimensionMismatch("IGESDraw_NetworkSubfigureDef : Init");
47 theEntities = allEntities;
48 theTypeFlag = aTypeFlag;
49 theDesignator = aDesignator;
50 theDesignatorTemplate = aTemplate;
51 thePointEntities = allPointEntities;
52 InitTypeAndForm(320,0);
55 Standard_Integer IGESDraw_NetworkSubfigureDef::Depth () const
60 Handle(TCollection_HAsciiString) IGESDraw_NetworkSubfigureDef::Name () const
65 Standard_Integer IGESDraw_NetworkSubfigureDef::NbEntities () const
67 return theEntities->Length();
70 Handle(IGESData_IGESEntity) IGESDraw_NetworkSubfigureDef::Entity
71 (const Standard_Integer Index) const
73 return theEntities->Value(Index);
74 // if Index is out of bound HArray1 will raise OutOfRange exception
77 Standard_Integer IGESDraw_NetworkSubfigureDef::TypeFlag () const
82 Handle(TCollection_HAsciiString) IGESDraw_NetworkSubfigureDef::Designator
88 Standard_Boolean IGESDraw_NetworkSubfigureDef::HasDesignatorTemplate () const
90 return (! theDesignatorTemplate.IsNull());
93 Handle(IGESGraph_TextDisplayTemplate)
94 IGESDraw_NetworkSubfigureDef::DesignatorTemplate () const
96 return theDesignatorTemplate;
99 Standard_Integer IGESDraw_NetworkSubfigureDef::NbPointEntities () const
101 return (thePointEntities.IsNull() ? 0 : thePointEntities->Length());
104 Standard_Boolean IGESDraw_NetworkSubfigureDef::HasPointEntity
105 (const Standard_Integer Index) const
107 if (thePointEntities.IsNull()) return Standard_False;
108 return (! thePointEntities->Value(Index).IsNull());
109 // if Index is out of bound HArray1 will raise OutOfRange exception
112 Handle(IGESDraw_ConnectPoint) IGESDraw_NetworkSubfigureDef::PointEntity
113 (const Standard_Integer Index) const
115 return thePointEntities->Value(Index);
116 // if Index is out of bound HArray1 will raise OutOfRange exception