|
||||
File indexing completed on 2025-01-18 10:03:57
0001 // Created on: 1992-12-18 0002 // Created by: Christian CAILLET 0003 // Copyright (c) 1992-1999 Matra Datavision 0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS 0005 // 0006 // This file is part of Open CASCADE Technology software library. 0007 // 0008 // This library is free software; you can redistribute it and/or modify it under 0009 // the terms of the GNU Lesser General Public License version 2.1 as published 0010 // by the Free Software Foundation, with special exception defined in the file 0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 0012 // distribution for complete text of the license and disclaimer of any warranty. 0013 // 0014 // Alternatively, this file may be used under the terms of Open CASCADE 0015 // commercial license or contractual agreement. 0016 0017 #ifndef _IGESData_FreeFormatEntity_HeaderFile 0018 #define _IGESData_FreeFormatEntity_HeaderFile 0019 0020 #include <Standard.hxx> 0021 0022 #include <TColStd_HSequenceOfInteger.hxx> 0023 #include <IGESData_UndefinedEntity.hxx> 0024 #include <Standard_Integer.hxx> 0025 #include <Interface_ParamType.hxx> 0026 #include <IGESData_HArray1OfIGESEntity.hxx> 0027 class IGESData_IGESEntity; 0028 class TCollection_HAsciiString; 0029 class IGESData_IGESWriter; 0030 0031 0032 class IGESData_FreeFormatEntity; 0033 DEFINE_STANDARD_HANDLE(IGESData_FreeFormatEntity, IGESData_UndefinedEntity) 0034 0035 //! This class allows to create IGES Entities in a literal form : 0036 //! their definition is free, but they are not recognized as 0037 //! instances of specific classes. 0038 //! 0039 //! This is a way to define test files without having to create 0040 //! and fill specific classes of Entities, or creating an IGES 0041 //! File ex nihilo, with respect for all format constraints 0042 //! (such a way is very difficult to run and to master). 0043 //! 0044 //! This class has the same content as an UndefinedEntity, only 0045 //! it gives way to act on its content 0046 class IGESData_FreeFormatEntity : public IGESData_UndefinedEntity 0047 { 0048 0049 public: 0050 0051 0052 //! Creates a completely empty FreeFormatEntity 0053 Standard_EXPORT IGESData_FreeFormatEntity(); 0054 0055 //! Sets Type Number to a new Value, and Form Number to Zero 0056 Standard_EXPORT void SetTypeNumber (const Standard_Integer typenum); 0057 0058 //! Sets Form Number to a new Value (to called after SetTypeNumber) 0059 Standard_EXPORT void SetFormNumber (const Standard_Integer formnum); 0060 0061 //! Gives count of recorded parameters 0062 Standard_EXPORT Standard_Integer NbParams() const; 0063 0064 //! Returns data of a Parameter : its type, and the entity if it 0065 //! designates en entity ("ent") or its literal value else ("str") 0066 //! Returned value (Boolean) : True if it is an Entity, False else 0067 Standard_EXPORT Standard_Boolean ParamData (const Standard_Integer num, Interface_ParamType& ptype, Handle(IGESData_IGESEntity)& ent, Handle(TCollection_HAsciiString)& val) const; 0068 0069 //! Returns the ParamType of a Param, given its rank 0070 //! Error if num is not between 1 and NbParams 0071 Standard_EXPORT Interface_ParamType ParamType (const Standard_Integer num) const; 0072 0073 //! Returns True if a Parameter is recorded as an entity 0074 //! Error if num is not between 1 and NbParams 0075 Standard_EXPORT Standard_Boolean IsParamEntity (const Standard_Integer num) const; 0076 0077 //! Returns Entity corresponding to a Param, given its rank 0078 //! Error if out of range or if Param num does not designate 0079 //! an Entity 0080 Standard_EXPORT Handle(IGESData_IGESEntity) ParamEntity (const Standard_Integer num) const; 0081 0082 //! Returns True if <num> is noted as for a "Negative Pointer" 0083 //! (see AddEntity for details). Senseful only if IsParamEntity 0084 //! answers True for <num>, else returns False. 0085 Standard_EXPORT Standard_Boolean IsNegativePointer (const Standard_Integer num) const; 0086 0087 //! Returns literal value of a Parameter, given its rank 0088 //! Error if num is out of range, or if Parameter is not literal 0089 Standard_EXPORT Handle(TCollection_HAsciiString) ParamValue (const Standard_Integer num) const; 0090 0091 //! Returns the complete list of Ramks of Parameters which have 0092 //! been noted as Negative Pointers 0093 //! Warning : It is returned as a Null Handle if none was noted 0094 Standard_EXPORT Handle(TColStd_HSequenceOfInteger) NegativePointers() const; 0095 0096 //! Adds a literal Parameter to the list (as such) 0097 Standard_EXPORT void AddLiteral (const Interface_ParamType ptype, const Handle(TCollection_HAsciiString)& val); 0098 0099 //! Adds a literal Parameter to the list (builds an HAsciiString) 0100 Standard_EXPORT void AddLiteral (const Interface_ParamType ptype, const Standard_CString val); 0101 0102 //! Adds a Parameter which references an Entity. If the Entity is 0103 //! Null, the added parameter will define a "Null Pointer" (0) 0104 //! If <negative> is given True, this will command Sending to File 0105 //! (see IGESWriter) to produce a "Negative Pointer" 0106 //! (Default is False) 0107 Standard_EXPORT void AddEntity (const Interface_ParamType ptype, const Handle(IGESData_IGESEntity)& ent, const Standard_Boolean negative = Standard_False); 0108 0109 //! Adds a set of Entities, given as a HArray1OfIGESEntity 0110 //! Causes creation of : an Integer Parameter which gives count 0111 //! of Entities, then the list of Entities of the Array 0112 //! Error if an Entity is not an IGESEntity 0113 //! All these Entities will be interpreted as "Positive Pointers" 0114 //! by IGESWriter 0115 Standard_EXPORT void AddEntities (const Handle(IGESData_HArray1OfIGESEntity)& ents); 0116 0117 //! Adds a list of Ranks of Parameters to be noted as Negative 0118 //! Pointers (this will be taken into account for Parameters 0119 //! which are Entities) 0120 Standard_EXPORT void AddNegativePointers (const Handle(TColStd_HSequenceOfInteger)& list); 0121 0122 //! Clears all information about Negative Pointers, hence every 0123 //! Entity kind Parameter will be sent normally, as Positive 0124 Standard_EXPORT void ClearNegativePointers(); 0125 0126 //! WriteOwnParams is redefined for FreeFormatEntity to take 0127 //! into account the supplementary information "Negative Pointer" 0128 Standard_EXPORT virtual void WriteOwnParams (IGESData_IGESWriter& IW) const Standard_OVERRIDE; 0129 0130 0131 0132 0133 DEFINE_STANDARD_RTTIEXT(IGESData_FreeFormatEntity,IGESData_UndefinedEntity) 0134 0135 protected: 0136 0137 0138 0139 0140 private: 0141 0142 0143 Handle(TColStd_HSequenceOfInteger) thenegptrs; 0144 0145 0146 }; 0147 0148 0149 0150 0151 0152 0153 0154 #endif // _IGESData_FreeFormatEntity_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |