1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402
|
// File generated by CPPExt (Value)
//
// Copyright (C) 1991 - 2000 by
// Matra Datavision SA. All rights reserved.
//
// Copyright (C) 2001 - 2004 by
// Open CASCADE SA. All rights reserved.
//
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.
#ifndef _StepData_StepWriter_HeaderFile
#define _StepData_StepWriter_HeaderFile
#ifndef _Handle_StepData_StepModel_HeaderFile
#include <Handle_StepData_StepModel.hxx>
#endif
#ifndef _Handle_TColStd_HSequenceOfHAsciiString_HeaderFile
#include <Handle_TColStd_HSequenceOfHAsciiString.hxx>
#endif
#ifndef _Interface_LineBuffer_HeaderFile
#include <Interface_LineBuffer.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Interface_FloatWriter_HeaderFile
#include <Interface_FloatWriter.hxx>
#endif
#ifndef _Interface_CheckIterator_HeaderFile
#include <Interface_CheckIterator.hxx>
#endif
#ifndef _Handle_TColStd_HArray1OfInteger_HeaderFile
#include <Handle_TColStd_HArray1OfInteger.hxx>
#endif
#ifndef _Handle_StepData_Protocol_HeaderFile
#include <Handle_StepData_Protocol.hxx>
#endif
#ifndef _Standard_CString_HeaderFile
#include <Standard_CString.hxx>
#endif
#ifndef _Handle_TCollection_HAsciiString_HeaderFile
#include <Handle_TCollection_HAsciiString.hxx>
#endif
#ifndef _Handle_StepData_PDescr_HeaderFile
#include <Handle_StepData_PDescr.hxx>
#endif
#ifndef _Handle_StepData_SelectMember_HeaderFile
#include <Handle_StepData_SelectMember.hxx>
#endif
#ifndef _Handle_StepData_ESDescr_HeaderFile
#include <Handle_StepData_ESDescr.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Handle_Standard_Transient_HeaderFile
#include <Handle_Standard_Transient.hxx>
#endif
#ifndef _StepData_Logical_HeaderFile
#include <StepData_Logical.hxx>
#endif
#ifndef _Handle_TColStd_HArray1OfReal_HeaderFile
#include <Handle_TColStd_HArray1OfReal.hxx>
#endif
#ifndef _Standard_OStream_HeaderFile
#include <Standard_OStream.hxx>
#endif
class StepData_StepModel;
class TColStd_HSequenceOfHAsciiString;
class TColStd_HArray1OfInteger;
class Interface_InterfaceMismatch;
class Interface_FloatWriter;
class StepData_Protocol;
class StepData_WriterLib;
class TCollection_AsciiString;
class TCollection_HAsciiString;
class StepData_Field;
class StepData_PDescr;
class StepData_SelectMember;
class StepData_FieldList;
class StepData_ESDescr;
class Standard_Transient;
class TColStd_HArray1OfReal;
class Interface_CheckIterator;
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif
//! manages atomic file writing, under control of StepModel (for <br>
//! general organisation of file) and each class of Transient <br>
//! (for its own parameters) : prepares text to be written then <br>
//! writes it <br>
//! A stream cannot be used because Step limits line length at 72 <br>
//! In more, a specific object offers more appropriate functions <br>
class StepData_StepWriter {
public:
void* operator new(size_t,void* anAddress)
{
return anAddress;
}
void* operator new(size_t size)
{
return Standard::Allocate(size);
}
void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// Methods PUBLIC
//
//! Creates an empty StepWriter from a StepModel. The StepModel <br>
//! provides the Number of Entities, as identifiers for File <br>
Standard_EXPORT StepData_StepWriter(const Handle(StepData_StepModel)& amodel);
//! ModeLabel controls how to display entity ids : <br>
//! 0 (D) gives entity number in the model <br>
//! 1 gives the already recorded label (else, its number) <br>
//! Warning : conflicts are not controlled <br>
Standard_EXPORT Standard_Integer& LabelMode() ;
//! TypeMode controls the type form to use : <br>
//! 0 (D) for normal long form <br>
//! 1 for short form (if a type name has no short form, normal <br>
//! long form is then used) <br>
Standard_EXPORT Standard_Integer& TypeMode() ;
//! Returns the embedded FloatWriter, which controls sending Reals <br>
//! Use this method to access FloatWriter in order to consult or <br>
//! change its options (MainFormat, FormatForRange,ZeroSuppress), <br>
//! because it is returned as the address of its field <br>
Standard_EXPORT Interface_FloatWriter& FloatWriter() ;
//! Declares the Entity Number <numscope> to correspond to a Scope <br>
//! which contains the Entity Number <numin>. Several calls to the <br>
//! same <numscope> add Entities in this Scope, in this order. <br>//! Error if <numin> is already declared in the Scope <br>
//! Warning : the declaration of the Scopes is assumed to be consistent, <br>
//! i.e. <numin> is not referenced from outside this Scope <br>
//! (not checked here) <br>
Standard_EXPORT void SetScope(const Standard_Integer numscope,const Standard_Integer numin) ;
//! Returns True if an Entity identified by its Number is in a Scope <br>
Standard_EXPORT Standard_Boolean IsInScope(const Standard_Integer num) const;
//! Sends the complete Model, included HEADER and DATA Sections <br>
//! Works with a WriterLib defined through a Protocol <br>
//! If <headeronly> is given True, only the HEADER Section is sent <br>
//! (used to Dump the Header of a StepModel) <br>
Standard_EXPORT void SendModel(const Handle(StepData_Protocol)& protocol,const Standard_Boolean headeronly = Standard_False) ;
//! Begins model header <br>
Standard_EXPORT void SendHeader() ;
//! Begins data section; error if EndSec was not set <br>
Standard_EXPORT void SendData() ;
//! Send an Entity of the Data Section. If it corresponds to a <br>
//! Scope, also Sends the Scope informations and contained Items <br>
Standard_EXPORT void SendEntity(const Standard_Integer nument,const StepData_WriterLib& lib) ;
//! sets end of section; to be done before passing to next one <br>
Standard_EXPORT void EndSec() ;
//! sets end of file; error is EndSec was not set <br>
Standard_EXPORT void EndFile() ;
//! flushes current line; if empty, flushes it (defines a new <br>
//! empty line) if evenempty is True; else, skips it <br>
Standard_EXPORT void NewLine(const Standard_Boolean evenempty) ;
//! joins current line to last one, only if new length is 72 max <br>
//! if newline is True, a new current line begins; else, current <br>
//! line is set to the last line (once joined) itself an can be <br>
//! completed <br>
Standard_EXPORT void JoinLast(const Standard_Boolean newline) ;
//! asks that further indentations will begin at position of <br>
//! entity first opening bracket; else they begin at zero (def) <br>
//! for each sublist level, two more blancks are added at beginning <br>
//! (except for text continuation, which must begin at true zero) <br>
Standard_EXPORT void Indent(const Standard_Boolean onent) ;
//! begins an entity with an ident plus '=' (at beginning of line) <br>
//! entity ident is its Number given by the containing Model <br>
//! Warning : <ident> must be, either Number or Label, according LabelMode <br>
Standard_EXPORT void SendIdent(const Standard_Integer ident) ;
//! sets a begin of Scope (ends this line) <br>
Standard_EXPORT void SendScope() ;
//! sets an end of Scope (on a separate line) <br>
Standard_EXPORT void SendEndscope() ;
//! sets a comment mark : if mode is True, begins Comment zone, <br>
//! if mode is False, ends Comment zone (if one is begun) <br>
Standard_EXPORT void Comment(const Standard_Boolean mode) ;
//! sends a comment. Error if we are not inside a comment zone <br>
Standard_EXPORT void SendComment(const Handle(TCollection_HAsciiString)& text) ;
//! same as above but accepts a CString (ex.: "..." directly) <br>
Standard_EXPORT void SendComment(const Standard_CString text) ;
//! sets entity's StepType, opens brakets, starts param no to 0 <br>
//! params are separated by comma <br>
//! Remark : for a Multiple Type Entity (see Express ANDOR clause) <br>
//! StartComplex must be called before sending componants, then <br>
//! each "Componant" must be send separately (one call to <br>
//! StartEntity for each one) : the Type which preceeds is then <br>
//! automaticaly closed. Once all the componants have been sent, <br>
//! EndComplex must be called, then and only then EndEntity <br>
Standard_EXPORT void StartEntity(const TCollection_AsciiString& atype) ;
//! sends the start of a complex entity, which is a simple open <br>
//! bracket (without increasing braket level) <br>
//! It must be called JUST AFTER SendEntity and BEFORE sending <br>
//! componants, each one begins by StartEntity <br>
Standard_EXPORT void StartComplex() ;
//! sends the end of a complex entity : a simple closed bracket <br>
//! It must be called AFTER sending all the componants and BEFORE <br>
//! the final call to EndEntity <br>
Standard_EXPORT void EndComplex() ;
//! Sends the content of a field, controlled by its descriptor <br>
//! If the descriptor is not defined, follows the description <br>
//! detained by the field itself <br>
Standard_EXPORT void SendField(const StepData_Field& fild,const Handle(StepData_PDescr)& descr) ;
//! Sends a SelectMember, which cab be named or not <br>
Standard_EXPORT void SendSelect(const Handle(StepData_SelectMember)& sm,const Handle(StepData_PDescr)& descr) ;
//! Send the content of an entity as being a FieldList controlled <br>
//! by its descriptor. This includes start and end brackets but <br>
//! not the entity type <br>
Standard_EXPORT void SendList(const StepData_FieldList& list,const Handle(StepData_ESDescr)& descr) ;
//! open a sublist by a '(' <br>
Standard_EXPORT void OpenSub() ;
//! open a sublist with its type then a '(' <br>
Standard_EXPORT void OpenTypedSub(const Standard_CString subtype) ;
//! closes a sublist by a ')' <br>
Standard_EXPORT void CloseSub() ;
//! prepares adding a parameter (that is, adds ',' except for <br>
//! first one); normally for internal use; can be used to send <br>
//! a totally empty parameter (with no litteral value) <br>
Standard_EXPORT void AddParam() ;
//! sends an integer parameter <br>
Standard_EXPORT void Send(const Standard_Integer val) ;
//! sends a real parameter (wroks with FloatWriter) <br>
Standard_EXPORT void Send(const Standard_Real val) ;
//! sends a text given as string (it will be set between '...') <br>
Standard_EXPORT void Send(const TCollection_AsciiString& val) ;
//! sends a reference to an entity (its identifier with '#') <br>
//! REMARK 1 : a Null <val> is interpreted as "Undefined" <br>
//! REMARK 2 : for an HAsciiString which is not recorded in the <br>
//! Model, it is send as its String Content, between quotes <br>
Standard_EXPORT void Send(const Handle(Standard_Transient)& val) ;
//! sends a Boolean as .T. for True or .F. for False <br>
//! (it is an useful case of Enum, which is built-in) <br>
Standard_EXPORT void SendBoolean(const Standard_Boolean val) ;
//! sends a Logical as .T. or .F. or .U. according its Value <br>
//! (it is a standard case of Enum for Step, and is built-in) <br>
Standard_EXPORT void SendLogical(const StepData_Logical val) ;
//! sends a string exactly as it is given <br>
Standard_EXPORT void SendString(const TCollection_AsciiString& val) ;
//! sends a string exactly as it is given <br>
Standard_EXPORT void SendString(const Standard_CString val) ;
//! sends an enum given by String (litteral expression) <br>
//! adds '.' around it if not done <br>
//! Remark : val can be computed by class EnumTool from StepData: <br>
//! StepWriter.SendEnum (myenum.Text(enumval)); <br>
Standard_EXPORT void SendEnum(const TCollection_AsciiString& val) ;
//! sends an enum given by String (litteral expression) <br>
//! adds '.' around it if not done <br>
Standard_EXPORT void SendEnum(const Standard_CString val) ;
//! sends an array of real <br>
Standard_EXPORT void SendArrReal(const Handle(TColStd_HArray1OfReal)& anArr) ;
//! sends an undefined (optionnal absent) parameter (by '$') <br>
Standard_EXPORT void SendUndef() ;
//! sends a "Derived" parameter (by '*'). A Derived Parameter has <br>
//! been inherited from a Super-Type then redefined as being <br>
//! computed by a function. Hence its value in file is senseless. <br>
Standard_EXPORT void SendDerived() ;
//! sends end of entity (closing bracket plus ';') <br>
//! Error if count of opened-closed brackets is not null <br>
Standard_EXPORT void EndEntity() ;
//! Returns the check-list, which has received possible checks : <br>
//! for unknown entities, badly loaded ones, null or unknown <br>
//! references <br>
Standard_EXPORT Interface_CheckIterator CheckList() const;
//! Returns count of Lines <br>
Standard_EXPORT Standard_Integer NbLines() const;
//! Returns a Line given its rank in the File <br>
Standard_EXPORT Handle_TCollection_HAsciiString Line(const Standard_Integer num) const;
//! writes result on an output defined as an OStream <br>
//! then clears it <br>
Standard_EXPORT Standard_Boolean Print(Standard_OStream& S) ;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
//! adds a string to current line; first flushes it if full <br>
//! (72 char); more allows to ask a reserve at end of line : flush <br>
//! is done if remaining length (to 72) is less than <more> <br>
Standard_EXPORT void AddString(const TCollection_AsciiString& str,const Standard_Integer more = 0) ;
//! Same as above, but the string is given by CString + Length <br>
Standard_EXPORT void AddString(const Standard_CString str,const Standard_Integer lnstr,const Standard_Integer more = 0) ;
// Fields PRIVATE
//
Handle_StepData_StepModel themodel;
Handle_TColStd_HSequenceOfHAsciiString thefile;
Interface_LineBuffer thecurr;
Standard_Boolean thesect;
Standard_Boolean thecomm;
Standard_Boolean thefirst;
Standard_Boolean themult;
Standard_Integer thelevel;
Standard_Boolean theindent;
Standard_Integer theindval;
Standard_Integer thetypmode;
Interface_FloatWriter thefloatw;
Interface_CheckIterator thechecks;
Standard_Integer thenum;
Standard_Integer thelabmode;
Handle_TColStd_HArray1OfInteger thescopebeg;
Handle_TColStd_HArray1OfInteger thescopeend;
Handle_TColStd_HArray1OfInteger thescopenext;
};
// other Inline functions and methods (like "C++: function call" methods)
//
#endif
|