]> OCCT Git - occt-copy.git/commitdiff
0031481: Data Exchange - provide parser of STEP EXPRESS schema for generation of...
authorskl <skl@opencascade.com>
Fri, 27 Nov 2020 06:10:38 +0000 (09:10 +0300)
committerskl <skl@opencascade.com>
Mon, 7 Dec 2020 09:01:20 +0000 (12:01 +0300)
Formatting added files from package Express following OCCT Coding Rules

39 files changed:
src/Express/Express.cxx
src/Express/Express.hxx
src/Express/Express_Alias.cxx
src/Express/Express_Alias.hxx
src/Express/Express_Boolean.hxx
src/Express/Express_ComplexType.cxx
src/Express/Express_ComplexType.hxx
src/Express/Express_DataMapOfAsciiStringItem.hxx
src/Express/Express_Entity.cxx
src/Express/Express_Entity.hxx
src/Express/Express_Enum.cxx
src/Express/Express_Enum.hxx
src/Express/Express_Field.cxx
src/Express/Express_Field.hxx
src/Express/Express_HSequenceOfEntity.hxx
src/Express/Express_HSequenceOfField.hxx
src/Express/Express_HSequenceOfItem.hxx
src/Express/Express_Integer.hxx
src/Express/Express_Item.cxx
src/Express/Express_Item.hxx
src/Express/Express_Logical.cxx
src/Express/Express_Logical.hxx
src/Express/Express_NamedType.cxx
src/Express/Express_NamedType.hxx
src/Express/Express_PredefinedType.hxx
src/Express/Express_Real.cxx
src/Express/Express_Real.hxx
src/Express/Express_Reference.cxx
src/Express/Express_Reference.hxx
src/Express/Express_Schema.cxx
src/Express/Express_Schema.hxx
src/Express/Express_Select.cxx
src/Express/Express_Select.hxx
src/Express/Express_SequenceOfEntity.hxx
src/Express/Express_SequenceOfField.hxx
src/Express/Express_SequenceOfItem.hxx
src/Express/Express_String.hxx
src/Express/Express_Type.cxx
src/Express/Express_Type.hxx

index 6ac1793577717c5d2e2b04602d1d991487d5378a..25f115bdf37fe1cc0127e1bf922ebccdc4e0a14b 100644 (file)
@@ -34,18 +34,21 @@ Handle(Express_Schema) &Express::Schema ()
                               
 //=======================================================================
 //function : WriteFileStamp
-//purpose  : 
+//purpose  : Write header of HXX or CXX file
 //=======================================================================
 
-// Write header of HXX or CXX file
 void Express::WriteFileStamp (Standard_OStream &os)
 {
-  static const char *EC_VERSION = "2.0";
+  static const charEC_VERSION = "2.0";
 
   Standard_CString comm = "//";
   TCollection_AsciiString timestring;
-  if ( getenv ( "EXPTOCAS_TIME" ) ) timestring = getenv ( "EXPTOCAS_TIME" );
-  else {
+  if (getenv("EXPTOCAS_TIME"))
+  {
+    timestring = getenv("EXPTOCAS_TIME");
+  }
+  else
+  {
     time_t curtime;
     time ( &curtime );
     timestring = ctime ( &curtime );
@@ -93,12 +96,18 @@ void Express::WriteMethodStamp (Standard_OStream &os, const Handle(TCollection_H
 
 Handle(TCollection_HAsciiString) Express::ToStepName (const Handle(TCollection_HAsciiString) &name)
 {
-  Handle(TCollection_HAsciiString) stepname = new TCollection_HAsciiString ( name );
-  for ( Standard_Integer i=2; i <= stepname->Length(); i++ )
-    if ( isupper ( stepname->Value(i) ) ) stepname->Insert ( i++, '_' );
+  Handle(TCollection_HAsciiString) stepname = new TCollection_HAsciiString(name);
+  for (Standard_Integer i = 2; i <= stepname->Length(); i++)
+  {
+    if (isupper(stepname->Value(i)))
+    {
+      stepname->Insert(i++, '_');
+    }
+  }
   stepname->LowerCase();
   return stepname;
 }
+
 //=======================================================================
 //function : GetPrefixEnum
 //purpose  : 
@@ -107,11 +116,13 @@ Handle(TCollection_HAsciiString) Express::ToStepName (const Handle(TCollection_H
 Handle(TCollection_HAsciiString) Express::EnumPrefix (const Handle(TCollection_HAsciiString) &name)
 {
   Handle(TCollection_HAsciiString) stepname = new TCollection_HAsciiString; 
-  for ( Standard_Integer i=1; i <= name->Length(); i++ )
-    if ( isupper ( name->Value(i) ) ) {
-      
-      stepname->AssignCat (new TCollection_HAsciiString(name->Value(i)) );
+  for (Standard_Integer i = 1; i <= name->Length(); i++)
+  {
+    if (isupper(name->Value(i)))
+    {
+      stepname->AssignCat(new TCollection_HAsciiString(name->Value(i)));
     }
+  }
   stepname->LowerCase();
   return stepname;
 }
index 544b01d62fe35974883fd6c49c7b0f39e86bf4d7..053a3503a9183454a799162db37ccf7c6461f1ef 100644 (file)
@@ -15,7 +15,6 @@
 #define _Express_HeaderFile
 
 #include <Standard_Type.hxx>
-
 #include <Standard_OStream.hxx>
 #include <Standard_Boolean.hxx>
 
@@ -32,7 +31,6 @@ public:
 
   DEFINE_STANDARD_ALLOC
 
-  
   //! Returns (modifiable) handle to static schema object
   Standard_EXPORT static   Handle(Express_Schema)& Schema() ;
   
index b270fe4706eeb6772f6db8eb23815428b1ad340e..1a09060dc2eaf8c2d48e5364ebb4fbc04cdd21bd 100644 (file)
@@ -23,9 +23,8 @@ IMPLEMENT_STANDARD_RTTIEXT(Express_Alias,Express_Item)
 //purpose  : 
 //=======================================================================
 
-Express_Alias::Express_Alias (const Standard_CString name, 
-                               const Handle(Express_Type) &type)
-     : Express_Item(name), myType(type)
+Express_Alias::Express_Alias(const Standard_CString name, const Handle(Express_Type) &type)
+  : Express_Item(name), myType(type)
 {
 }
 
@@ -56,7 +55,8 @@ Handle(TCollection_HAsciiString) Express_Alias::CPPName () const
 
 Standard_Boolean Express_Alias::GenerateClass () const
 {
-//  std::cout << "Warning: writing ALIAS is not yet implemented, cannot generate " << Name()->ToCString() << std::endl;
-  std::cout << "ALIAS " << Name()->ToCString() << " = " << Type()->CPPName()->ToCString() << " used; no generation is needed" << std::endl;
+  //std::cout << "Warning: writing ALIAS is not yet implemented, cannot generate " << Name()->ToCString() << std::endl;
+  std::cout << "ALIAS " << Name()->ToCString() << " = " << Type()->CPPName()->ToCString()
+    << " used; no generation is needed" << std::endl;
   return Standard_False;
 }
index 3498604d6dc7b98e0ae20f4fcc977c0933a0791c..d1c18ea3f2c6b0ae25d41d43b6f74af8a2213f94 100644 (file)
 
 class TCollection_HAsciiString;
 
-
 //! Implements TYPE = type (alias) item of the EXPRESS
 //! schema, with interface for deferred Item class.
 class Express_Alias : public Express_Item
 {
 
 public:
-
   
   //! Create ALIAS item and initialize it
   Standard_EXPORT Express_Alias(const Standard_CString name, const Handle(Express_Type)& type);
@@ -41,28 +39,15 @@ public:
   //! Create HXX/CXX files from item
   Standard_EXPORT virtual   Standard_Boolean GenerateClass()  const Standard_OVERRIDE;
 
-
-
-
   DEFINE_STANDARD_RTTIEXT(Express_Alias,Express_Item)
 
 protected:
 
 
-
-
 private: 
 
-
   Handle(Express_Type) myType;
 
-
 };
 
-
-
-
-
-
-
 #endif // _Express_Alias_HeaderFile
index f97d8461564ad36b0c32ea06f4277db9ce5aa836..f859118c75471abbe4a1e993f17d2d9659aba0ec 100644 (file)
 #define _Express_Boolean_HeaderFile
 
 #include <Standard_Type.hxx>
-
 #include <Express_PredefinedType.hxx>
 class TCollection_HAsciiString;
 
-
 //! Implements EXPRESS type 'BOOLEAN'
 class Express_Boolean : public Express_PredefinedType
 {
 
 public:
-
   
   //! Empty constructor
   Standard_EXPORT Express_Boolean();
   
   //! Returns "Standard_Boolean"
   Standard_EXPORT virtual   Handle(TCollection_HAsciiString) CPPName()  const Standard_OVERRIDE;
-  
-
-
 
   DEFINE_STANDARD_RTTIEXT(Express_Boolean,Express_PredefinedType)
 
 protected:
 
-
-
-
 private: 
 
-
-
-
 };
 
-
-
-
-
-
-
 #endif // _Express_Boolean_HeaderFile
index b5fc6b0eab6eb1f0496667eef5c504264a9056d3..a233c99839477c3bd08272839826860b6dc2c117 100644 (file)
@@ -24,9 +24,10 @@ IMPLEMENT_STANDARD_RTTIEXT(Express_ComplexType,Express_Type)
 //purpose  : 
 //=======================================================================
 
-Express_ComplexType::Express_ComplexType (const Standard_Integer imin,
-                                           const Standard_Integer imax,
-                                           const Handle(Express_Type) &type) 
+Express_ComplexType::Express_ComplexType (
+  const Standard_Integer imin,
+  const Standard_Integer imax,
+  const Handle(Express_Type) &type)
 {
   myMin = imin;
   myMax = imax;
@@ -52,28 +53,44 @@ Handle(TCollection_HAsciiString) Express_ComplexType::CPPName () const
 {
    // check if array 2
   Handle(Express_Type) type = myType;
-  if ( type->IsKind ( STANDARD_TYPE(Express_ComplexType) ) ) {
-    Handle(Express_ComplexType) c2 = Handle(Express_ComplexType)::DownCast ( type );
+  if (type->IsKind(STANDARD_TYPE(Express_ComplexType)))
+  {
+    Handle(Express_ComplexType) c2 = Handle(Express_ComplexType)::DownCast(type);
     type = c2->Type();
   }
 
   // parse name of array argument
   Handle(TCollection_HAsciiString) name = type->CPPName();
-  Standard_Integer split = name->Location ( 1, '_', 1, name->Length() );
+  Standard_Integer split = name->Location(1, '_', 1, name->Length());
   Handle(TCollection_HAsciiString) cls;
-  if ( split ) cls = name->Split ( split );
-  else cls = name;
+  if (split)
+  {
+    cls = name->Split(split);
+  }
+  else
+  {
+    cls = name;
+  }
   Handle(TCollection_HAsciiString) str = new TCollection_HAsciiString("TCollection");
-  Standard_Integer ind =name->Location(str,1,name->Length());
-  if(ind) 
-    name = new TCollection_HAsciiString ( "Interface_" );
+  Standard_Integer ind = name->Location(str, 1, name->Length());
+  if (ind)
+  {
+    name = new TCollection_HAsciiString("Interface_");
+  }
   // generate name
-  if ( type->IsStandard() || ! split ) {
-      name = new TCollection_HAsciiString ( "TColStd_" );
+  if (type->IsStandard() || !split)
+  {
+    name = new TCollection_HAsciiString("TColStd_");
+  }
+  if (type == myType)
+  {
+    name->AssignCat("HArray1Of");
+  }
+  else
+  {
+    name->AssignCat("HArray2Of");
   }
-  if ( type == myType ) name->AssignCat ( "HArray1Of" );
-  else                  name->AssignCat ( "HArray2Of" );
-  name->AssignCat ( cls );
+  name->AssignCat(cls);
   return name;
 }
 
@@ -82,9 +99,9 @@ Handle(TCollection_HAsciiString) Express_ComplexType::CPPName () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Express_ComplexType::Use (const Handle(TCollection_HAsciiString) &pack,
-                                           const Standard_Boolean defer) const
+Standard_Boolean Express_ComplexType::Use(
+  const Handle(TCollection_HAsciiString) &pack,
+  const Standard_Boolean defer) const
 {
-  
   return myType->Use ( pack, defer );
 }
index e002575d38e147a67d9a1a258b3e900a00a79ce1..3d7b2a372a58051f04540a372b62f05a31e216c1 100644 (file)
 #define _Express_ComplexType_HeaderFile
 
 #include <Standard_Type.hxx>
-
 #include <Express_Type.hxx>
-
 class TCollection_HAsciiString;
 
-
 //! Base class for complex types (ARRAY, LIST, BAG, SET)
 //! in EXPRESS schema
 //! Stores type of elements and
@@ -28,10 +25,12 @@ class Express_ComplexType : public Express_Type
 {
 
 public:
-
   
   //! Creates an object and initializes fields
-  Standard_EXPORT Express_ComplexType(const Standard_Integer imin, const Standard_Integer imax, const Handle(Express_Type)& type);
+  Standard_EXPORT Express_ComplexType(
+    const Standard_Integer imin,
+    const Standard_Integer imax,
+    const Handle(Express_Type)& type);
   
   //! Returns type of complex type items
   Standard_EXPORT  const  Handle(Express_Type)& Type()  const;
@@ -41,32 +40,20 @@ public:
   
   //! Declares type as used by some item being generated.
   //! Calls Use() for type of elements
-  Standard_EXPORT virtual   Standard_Boolean Use (const Handle(TCollection_HAsciiString)& pack, const Standard_Boolean defer = Standard_False)  const Standard_OVERRIDE;
-
-
-
+  Standard_EXPORT virtual   Standard_Boolean Use(
+    const Handle(TCollection_HAsciiString)& pack,
+    const Standard_Boolean defer = Standard_False)  const Standard_OVERRIDE;
 
   DEFINE_STANDARD_RTTIEXT(Express_ComplexType,Express_Type)
 
 protected:
 
-
-
-
 private: 
 
-
   Standard_Integer myMin;
   Standard_Integer myMax;
   Handle(Express_Type) myType;
 
-
 };
 
-
-
-
-
-
-
 #endif // _Express_ComplexType_HeaderFile
index 609831747134ffce6574dfe9fe2980bdb97440d1..b33454fe4808032b8d7a6d21bedb159e4f8ce9ad 100644 (file)
@@ -18,7 +18,9 @@
 #include <Express_Item.hxx>
 #include <NCollection_DataMap.hxx>
 
-typedef NCollection_DataMap<TCollection_AsciiString,Handle(Express_Item),TCollection_AsciiString> Express_DataMapOfAsciiStringItem;
-typedef NCollection_DataMap<TCollection_AsciiString,Handle(Express_Item),TCollection_AsciiString>::Iterator Express_DataMapIteratorOfDataMapOfAsciiStringItem;
+typedef NCollection_DataMap<TCollection_AsciiString,Handle(Express_Item),
+  TCollection_AsciiString> Express_DataMapOfAsciiStringItem;
+typedef NCollection_DataMap<TCollection_AsciiString,Handle(Express_Item),
+  TCollection_AsciiString>::Iterator Express_DataMapIteratorOfDataMapOfAsciiStringItem;
 
 #endif
index f507f4bfc6790c34bda36fee49b5f46f13e2337e..30a8e3a99953c1e4a6cbdd511b0a14a15f5638a5 100644 (file)
@@ -43,16 +43,22 @@ IMPLEMENT_STANDARD_RTTIEXT(Express_Entity,Express_Item)
 //purpose  : 
 //=======================================================================
 
-Express_Entity::Express_Entity (const Standard_CString name, 
-                                 const Handle(TColStd_HSequenceOfHAsciiString) &inherit,
-                                 const Handle(Express_HSequenceOfField) &flds)
-     : Express_Item(name), mySupers(inherit), myFields(flds)
-       
+Express_Entity::Express_Entity(
+  const Standard_CString name,
+  const Handle(TColStd_HSequenceOfHAsciiString) &inherit,
+  const Handle(Express_HSequenceOfField) &flds)
+  : Express_Item(name), mySupers(inherit), myFields(flds)
 {
   // make empty lists to avoid checking every time
   myInherit = new Express_HSequenceOfEntity;
-  if ( mySupers.IsNull() ) mySupers = new TColStd_HSequenceOfHAsciiString;
-  if ( myFields.IsNull() ) myFields = new Express_HSequenceOfField;
+  if (mySupers.IsNull())
+  {
+    mySupers = new TColStd_HSequenceOfHAsciiString;
+  }
+  if (myFields.IsNull())
+  {
+    myFields = new Express_HSequenceOfField;
+  }
   myisAbstract = Standard_False;
 }
 
@@ -93,9 +99,12 @@ const Handle(Express_HSequenceOfField) &Express_Entity::Fields () const
 Standard_Integer Express_Entity::NbFields (const Standard_Boolean inherited) const
 {
   Standard_Integer num = myFields->Length();
-  if ( inherited ) {
-    for ( Standard_Integer i=1; i <= myInherit->Length(); i++ )
-      num += myInherit->Value(i)->NbFields ( inherited );
+  if (inherited)
+  {
+    for (Standard_Integer i = 1; i <= myInherit->Length(); i++)
+    {
+      num += myInherit->Value(i)->NbFields(inherited);
+    }
   }
   return num;
 }
@@ -105,15 +114,16 @@ Standard_Integer Express_Entity::NbFields (const Standard_Boolean inherited) con
 //purpose  : 
 //=======================================================================
 
-static void WriteGetMethod (Standard_OStream &os, 
-                           const Handle(TCollection_HAsciiString) name,
-                           const Handle(TCollection_HAsciiString) field,
-                           const Handle(TCollection_HAsciiString) type,
-                           const Standard_Boolean isHandle,
-                           const Standard_Boolean /*isSimple*/)
+static void WriteGetMethod(
+  Standard_OStream &os,
+  const Handle(TCollection_HAsciiString) name,
+  const Handle(TCollection_HAsciiString) field,
+  const Handle(TCollection_HAsciiString) type,
+  const Standard_Boolean isHandle,
+  const Standard_Boolean /*isSimple*/)
 {
   Handle(TCollection_HAsciiString) method = field;//new TCollection_HAsciiString ( "Get" );
-//  method->AssignCat ( field );
+  //method->AssignCat ( field );
   Express::WriteMethodStamp ( os, method );
   os << ( isHandle ? "Handle(" : "" ) << type->ToCString() << ( isHandle ? ") " : " " ) <<
        name->ToCString() << "::" << method->ToCString() << " () const" << std::endl;
@@ -125,19 +135,20 @@ static void WriteGetMethod (Standard_OStream &os,
 //purpose  : 
 //=======================================================================
 
-static void WriteSetMethod (Standard_OStream &os, 
-                           const Handle(TCollection_HAsciiString) name,
-                           const Handle(TCollection_HAsciiString) field,
-                           const Handle(TCollection_HAsciiString) type,
-                           const Standard_Boolean isHandle,
-                           const Standard_Boolean isSimple)
+static void WriteSetMethod(
+  Standard_OStream &os,
+  const Handle(TCollection_HAsciiString) name,
+  const Handle(TCollection_HAsciiString) field,
+  const Handle(TCollection_HAsciiString) type,
+  const Standard_Boolean isHandle,
+  const Standard_Boolean isSimple)
 {
-  Handle(TCollection_HAsciiString) method = new TCollection_HAsciiString ( "Set" );
-  method->AssignCat ( field );
-  Express::WriteMethodStamp ( os, method );
+  Handle(TCollection_HAsciiString) method = new TCollection_HAsciiString("Set");
+  method->AssignCat(field);
+  Express::WriteMethodStamp(os, method);
   os << "void " << name->ToCString() << "::" << method->ToCString() << " (const " <<
-        ( isHandle ? "Handle(" : "" ) << type->ToCString() << ( isHandle ? ")" : "" ) <<
-    ( isSimple ? "" : "&" ) << " the" << field->ToCString() << ")" << std::endl;
+    (isHandle ? "Handle(" : "") << type->ToCString() << (isHandle ? ")" : "") <<
+    (isSimple ? "" : "&") << " the" << field->ToCString() << ")" << std::endl;
   os << "{" << std::endl << "  my" << field->ToCString() << " = the" << field->ToCString() << ";\n}" << std::endl;
 }
 
@@ -148,7 +159,7 @@ static void WriteSetMethod (Standard_OStream &os,
 
 static inline void WriteSpaces (Standard_OStream &os, Standard_Integer num)
 {
-  for ( Standard_Integer i=0; i < num; i++ ) os << " ";
+  for (Standard_Integer i = 0; i < num; i++) os << " ";
 }
 
 //=======================================================================
@@ -180,11 +191,13 @@ Standard_Boolean Express_Entity::GenerateClass () const
   Express::WriteFileStamp ( os );
 
   Handle(TCollection_HAsciiString) InheritName = new TCollection_HAsciiString("Standard_Transient");
-  if (myInherit->Length() > 0) { // first inherited class will be actually inherited
+  if (myInherit->Length() > 0)
+  { // first inherited class will be actually inherited
     Handle(Express_Entity) it = myInherit->Value(1);
     it->Use(GetPackageName());
     InheritName = it->CPPName();
-    if (myInherit->Length() > 1) {
+    if (myInherit->Length() > 1)
+    {
       std::cout << "Warning: ENTITY " << Name()->ToCString() << " defined with multiple inheritance;" << std::endl;
       std::cout << "Warning: only first base class is actually inherited, others are made fields" << std::endl;
     }
@@ -265,26 +278,40 @@ Standard_Boolean Express_Entity::GenerateClass () const
   os << std::endl;
 
   // write fields section
-  if ( myInherit->Length() >1 || myFields->Length() >0 ) {
+  if ( myInherit->Length() >1 || myFields->Length() >0 )
+  {
     os << "private:" << std::endl;
-    for (Standard_Integer i = 2; i <= myInherit->Length(); i++) {
+    for (Standard_Integer i = 2; i <= myInherit->Length(); i++)
+    {
       Handle(Express_Entity) it = myInherit->Value(i);
       Handle(TCollection_HAsciiString) name = it->Name();
       os << "  Handle(" << it->CPPName()->ToCString() << ") my" << name->ToCString() << "; //!< supertype" << std::endl;
     }
-    for (Standard_Integer i = 1; i <= myFields->Length(); i++) {
+    for (Standard_Integer i = 1; i <= myFields->Length(); i++)
+    {
       Handle(Express_Field) field = myFields->Value(i);
       if (field->Type()->IsHandle())
+      {
         os << "  Handle(" << field->Type()->CPPName()->ToCString() << ") my" << field->Name()->ToCString() << ";";
+      }
       else
+      {
         os << "  " << field->Type()->CPPName()->ToCString() << " my" << field->Name()->ToCString() << ";";
-      if (field->IsOptional()) os << " //!< optional";
+      }
+      if (field->IsOptional())
+      {
+        os << " //!< optional";
+      }
       os << std::endl;
     }
     // optional fields: flag 'is field set'
-    for (Standard_Integer i = 1; i <= myFields->Length(); i++) {
+    for (Standard_Integer i = 1; i <= myFields->Length(); i++)
+    {
       Handle(Express_Field) field = myFields->Value(i);
-      if (!field->IsOptional()) continue;
+      if (!field->IsOptional())
+      {
+        continue;
+      }
       os << "  Standard_Boolean def" << field->Name()->ToCString() << "; //!< flag \"is " <<
         field->Name()->ToCString() << " defined\"" << std::endl;
     }
@@ -314,14 +341,16 @@ Standard_Boolean Express_Entity::GenerateClass () const
   Express::WriteMethodStamp ( os, CPPname );
   os << CPPname->ToCString() << "::" << CPPname->ToCString() << " ()" << std::endl;
   os << "{" << std::endl;
-  for (Standard_Integer i=1; i <= myFields->Length(); i++ ) {
+  for (Standard_Integer i=1; i <= myFields->Length(); i++ )
+  {
     Handle(Express_Field) field = myFields->Value ( i );
     if ( field->IsOptional() ) os << "  def" << field->Name()->ToCString() << " = Standard_False;" << std::endl;
   }
   os << "}" << std::endl;
 
   // write method Init()
-  if ( myInherit->Length() >1 || myFields->Length() >0 ) {
+  if ( myInherit->Length() >1 || myFields->Length() >0 )
+  {
     Express::WriteMethodStamp ( os, new TCollection_HAsciiString ( "Init" ) );
     os << "void " << CPPname->ToCString() << "::Init (";
     MakeInit ( os, 13 + CPPname->Length(), Standard_True, 1 );
@@ -331,17 +360,22 @@ Standard_Boolean Express_Entity::GenerateClass () const
   }
   
   // write "methods" section
-  for (Standard_Integer i=2; i <= myInherit->Length(); i++ ) {
+  for (Standard_Integer i=2; i <= myInherit->Length(); i++ )
+  {
     Handle(Express_Entity) it = myInherit->Value(i);
     WriteGetMethod ( os, CPPname, it->Name(), it->CPPName(), Standard_True, Standard_False );
     WriteSetMethod ( os, CPPname, it->Name(), it->CPPName(), Standard_True, Standard_False );
   }
-  for (Standard_Integer i=1; i <= myFields->Length(); i++ ) {
+  for (Standard_Integer i=1; i <= myFields->Length(); i++ )
+  {
     Handle(Express_Field) field = myFields->Value ( i );
     Handle(Express_Type) type = field->Type();
     WriteGetMethod ( os, CPPname, field->Name(), type->CPPName(), type->IsHandle(), type->IsSimple() );
     WriteSetMethod ( os, CPPname, field->Name(), type->CPPName(), type->IsHandle(), type->IsSimple() );
-    if ( ! field->IsOptional() ) continue;
+    if (!field->IsOptional())
+    {
+      continue;
+    }
     Handle(TCollection_HAsciiString) method = new TCollection_HAsciiString ( "Has" );
     method->AssignCat ( field->Name() );
     Express::WriteMethodStamp ( os, method );
@@ -401,7 +435,8 @@ Standard_Boolean Express_Entity::GenerateClass () const
   os << "  Standard_EXPORT " << RWCPPName->ToCString() << "();" << std::endl << std::endl;
 
   // read step
-  os << "  Standard_EXPORT void ReadStep(const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(" <<
+  os << "  Standard_EXPORT void ReadStep(const Handle(StepData_StepReaderData)& data," <<
+    " const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(" <<
     CPPName()->ToCString() << ")& ent) const;" << std::endl << std::endl;
 
   // write step
@@ -440,7 +475,7 @@ Standard_Boolean Express_Entity::GenerateClass () const
   os << RWCPPName->ToCString() << "::" << RWCPPName->ToCString() << "() {}" << std::endl << std::endl;
 
   // write method ReadStep
-  Express::WriteMethodStamp ( os, new TCollection_HAsciiString ( "ReadStep" ) );
+  Express::WriteMethodStamp(os, new TCollection_HAsciiString("ReadStep"));
   os << "void " << RWCPPName->ToCString() << "::ReadStep (const Handle(StepData_StepReaderData)& data," << std::endl;
   WriteSpaces ( os, 17 + RWCPPName->Length() );
   os << "const Standard_Integer num," << std::endl;
@@ -452,9 +487,9 @@ Standard_Boolean Express_Entity::GenerateClass () const
   Standard_Integer nbFld = NbFields ( Standard_True );
   
   os << "  // Check number of parameters" << std::endl;
-  os << "  if ( ! data->CheckNbParams(num," << nbFld << ",ach,\"" << 
-        Express::ToStepName ( Name() )->ToCString() << "\") ) return;" << std::endl;
-  WriteRWReadCode ( os, 1, Standard_True ); // write code for reading inherited and own fields
+  os << "  if ( ! data->CheckNbParams(num," << nbFld << ",ach,\"" <<
+    Express::ToStepName(Name())->ToCString() << "\") ) return;" << std::endl;
+  WriteRWReadCode(os, 1, Standard_True); // write code for reading inherited and own fields
   os << std::endl;
   os << "  // Initialize entity" << std::endl;
   os << "  ent->Init(";
@@ -468,7 +503,7 @@ Standard_Boolean Express_Entity::GenerateClass () const
   os << "const Handle(" << CPPname->ToCString() << ")& ent) const" << std::endl;
   os << "{" << std::endl;
   
-  WriteRWWriteCode ( os, 0, Standard_True ); // write code for writing inherited and own fields
+  WriteRWWriteCode(os, 0, Standard_True); // write code for writing inherited and own fields
   os << "}" << std::endl;
 
   // write method Share
@@ -479,8 +514,9 @@ Standard_Boolean Express_Entity::GenerateClass () const
   os << "{" << std::endl;
   WriteRWShareCode ( os, 1, Standard_True ); // write code for filling graph of references
   os << "}" << std::endl;
-  if(CheckFlag()) {
-    Express::WriteMethodStamp ( os, new TCollection_HAsciiString ( "Check" ) );
+  if(CheckFlag())
+  {
+    Express::WriteMethodStamp(os, new TCollection_HAsciiString("Check"));
     os << "void " << RWCPPName->ToCString() << "::Check(const Handle(Standard_Transient)& entt," << std::endl;
     WriteSpaces ( os, 18 + RWCPPName->Length() );
     os << "const Interface_ShareTool& shares,"<< std::endl;
@@ -491,16 +527,17 @@ Standard_Boolean Express_Entity::GenerateClass () const
     os<<"  Handle("<<CPPname->ToCString() << ") ent = Handle("<<CPPname->ToCString() <<")::DownCast(entt);"<< std::endl;
     os << "}" << std::endl;
   }
-  if(FillSharedFlag()) {
-    Express::WriteMethodStamp ( os, new TCollection_HAsciiString ( "FillShared" ) );
+  if(FillSharedFlag())
+  {
+    Express::WriteMethodStamp(os, new TCollection_HAsciiString("FillShared"));
     os << "void " << RWCPPName->ToCString() << "::Share(const Handle(Interface_InterfaceModel)& model," << std::endl;
-    WriteSpaces ( os, 18 + RWCPPName->Length() );
-    os << "const Handle(Standard_Transient)& entt,"<< std::endl;
-    WriteSpaces ( os, 18 + RWCPPName->Length() );
-    os << "Interface_EntityIterator& iter) const"<< std::endl;
+    WriteSpaces(os, 18 + RWCPPName->Length());
+    os << "const Handle(Standard_Transient)& entt," << std::endl;
+    WriteSpaces(os, 18 + RWCPPName->Length());
+    os << "Interface_EntityIterator& iter) const" << std::endl;
     os << "{" << std::endl;
     //DownCast entity to it's type
-    os<<"  Handle("<<CPPname->ToCString() << ") ent = Handle("<<CPPname->ToCString() <<")::DownCast(entt)"<< std::endl;
+    os << "  Handle(" << CPPname->ToCString() << ") ent = Handle(" << CPPname->ToCString() << ")::DownCast(entt)" << std::endl;
     os << "}" << std::endl;
   }
   
@@ -514,14 +551,14 @@ Standard_Boolean Express_Entity::GenerateClass () const
   TCollection_AsciiString regDir = "Registration";
   OSD_Path path_reg(regDir);
   OSD_Directory dir_reg(regDir);
-  dir_reg.Build ( prot );
+  dir_reg.Build(prot);
   regDir += "/";
-  
+
   TCollection_AsciiString packname_inc = "inc.txt";
   TCollection_AsciiString packname_rwinc = "rwinc.txt";
   // write file with includes
   os.open(regDir.Cat(packname_inc).ToCString(), std::ios::app);
-  os <<"#include <" << CPPName()->ToCString() << ".hxx>" << std::endl;
+  os << "#include <" << CPPName()->ToCString() << ".hxx>" << std::endl;
   os.close();
   // write file with RW includes
   os.open(regDir.Cat(packname_rwinc).ToCString(), std::ios::app);
@@ -529,7 +566,8 @@ Standard_Boolean Express_Entity::GenerateClass () const
   os.close();
 
   // generate data for entity registration
-  if (anIndex > 0) {
+  if (anIndex > 0)
+  {
     // StepAP214_Protocol.cxx
     TCollection_AsciiString packname_protocol = "protocol.txt";
     os.open(regDir.Cat(packname_protocol).ToCString(), std::ios::app);
@@ -566,7 +604,7 @@ Standard_Boolean Express_Entity::GenerateClass () const
     TCollection_AsciiString packname_reco = "reco.txt";
     os.open(regDir.Cat(packname_reco).ToCString(), std::ios::app);
     os << "  static TCollection_AsciiString Reco_" << Name()->ToCString() << "(\""
-       << recoName->ToCString() << "\");" << std::endl;
+      << recoName->ToCString() << "\");" << std::endl;
     os.close();
     //type bind
     TCollection_AsciiString packname_typebind = "typebind.txt";
@@ -611,25 +649,40 @@ Standard_Boolean Express_Entity::GenerateClass () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Express_Entity::WriteIncludes (Standard_OStream &os, 
-                                            DataMapOfStringInteger &dict) const
+Standard_Boolean Express_Entity::WriteIncludes(
+  Standard_OStream &os,
+  DataMapOfStringInteger &dict) const
 {
-  for ( Standard_Integer i=1; i <= myInherit->Length(); i++ ) {
+  for (Standard_Integer i = 1; i <= myInherit->Length(); i++)
+  {
     Handle(Express_Entity) it = myInherit->Value(i);
-    it->WriteIncludes ( os, dict );
-    if ( i <= 1 ) continue;
+    it->WriteIncludes(os, dict);
+    if (i <= 1)
+    {
+      continue;
+    }
 
-    if ( dict.IsBound ( it->CPPName()->String() ) ) continue; // avoid duplicating
-    dict.Bind ( it->CPPName()->String(), 1 );
-    it->Use ( GetPackageName() );
+    if (dict.IsBound(it->CPPName()->String()))
+    {
+      continue; // avoid duplicating
+    }
+    dict.Bind(it->CPPName()->String(), 1);
+    it->Use(GetPackageName());
     os << "#include <" << it->CPPName()->ToCString() << ".hxx>" << std::endl;
   }
-  for (Standard_Integer i=1; i <= myFields->Length(); i++ ) {
+  for (Standard_Integer i = 1; i <= myFields->Length(); i++)
+  {
     Handle(Express_Type) type = myFields->Value(i)->Type();
-    if ( dict.IsBound ( type->CPPName()->String() ) ) continue; // avoid duplicating
-    dict.Bind ( type->CPPName()->String(), 1 );
-    type->Use ( GetPackageName() );
-    if ( type->IsStandard() ) continue;
+    if (dict.IsBound(type->CPPName()->String()))
+    {
+      continue; // avoid duplicating
+    }
+    dict.Bind(type->CPPName()->String(), 1);
+    type->Use(GetPackageName());
+    if (type->IsStandard())
+    {
+      continue;
+    }
     os << "#include <" << type->CPPName()->ToCString() << ".hxx>" << std::endl;
   }
   return Standard_True;
@@ -642,74 +695,109 @@ Standard_Boolean Express_Entity::WriteIncludes (Standard_OStream &os,
 
 void Express_Entity::WriteRWInclude (Standard_OStream &os, DataMapOfStringInteger &dict) const
 {
-  for ( Standard_Integer i=1; i <= myInherit->Length(); i++ ) {
+  for (Standard_Integer i = 1; i <= myInherit->Length(); i++)
+  {
     Handle(Express_Entity) it = myInherit->Value(i);
-    if ( i >1 ) { // include HXX for base classes which are implemented as fields
+    if (i > 1)
+    { // include HXX for base classes which are implemented as fields
       os << "#include <" << it->CPPName()->ToCString() << ".hxx>" << std::endl;
     }
-    it->WriteRWInclude ( os, dict );
+    it->WriteRWInclude(os, dict);
   }
-  for (Standard_Integer i=1; i <= myFields->Length(); i++ ) {
+  for (Standard_Integer i = 1; i <= myFields->Length(); i++)
+  {
     Handle(Express_Type) type = myFields->Value(i)->Type();
-    for ( Standard_Integer deep=0; deep < 10; deep++ ) {
-      if ( dict.IsBound ( type->CPPName()->String() ) ) break; // avoid duplicating
-      dict.Bind ( type->CPPName()->String(), 1 );
+    for (Standard_Integer deep = 0; deep < 10; deep++)
+    {
+      if (dict.IsBound(type->CPPName()->String()))
+      {
+        break; // avoid duplicating
+      }
+      dict.Bind(type->CPPName()->String(), 1);
       os << "#include <" << type->CPPName()->ToCString() << ".hxx>" << std::endl;
-      
-      Handle(Express_ComplexType) complex = Handle(Express_ComplexType)::DownCast ( type );
+
+      Handle(Express_ComplexType) complex = Handle(Express_ComplexType)::DownCast(type);
       if (complex.IsNull())
+      {
         break;
+      }
       type = complex->Type();
     }
   }
 }
 
 //=======================================================================
-//function : WriteRWReadField
-//purpose  : 
+//function : typeToSTEPName
+//purpose  : auxilary for WriteRWReadField
 //=======================================================================
 
-static Handle(TCollection_HAsciiString) TypeToSTEPName (const Handle(Express_Type) &type) 
+static Handle(TCollection_HAsciiString) typeToSTEPName (const Handle(Express_Type) &type) 
 {
   Handle(TCollection_HAsciiString) cppname = type->CPPName();
   Handle(TCollection_HAsciiString) cls = cppname->Token ( "_", 2 );
-  if ( cls->Length() <1 ) cls = cppname;
-  return Express::ToStepName ( cls );
+  if (cls->Length() < 1)
+  {
+    cls = cppname;
+  }
+  return Express::ToStepName(cls);
 }
 
-static void WriteRWReadField (Standard_OStream &os, 
-                              const Standard_CString index,
-                              const Standard_CString STEPName,
-                              const Standard_CString varname,
-                              const Handle(Express_Type) &vartype, 
-                              const Standard_Integer lev,
-                              const Standard_Boolean optional)
+//=======================================================================
+//function : WriteRWReadField
+//purpose  : 
+//=======================================================================
+
+static void WriteRWReadField(
+  Standard_OStream &os,
+  const Standard_CString index,
+  const Standard_CString STEPName,
+  const Standard_CString varname,
+  const Handle(Express_Type) &vartype,
+  const Standard_Integer lev,
+  const Standard_Boolean optional)
 {
   // indent
   TCollection_AsciiString shift ( "  " );
   Standard_Integer level = 0;
-  for (; level < lev; level++ ) shift += "  ";
+  for (; level < lev; level++)
+  {
+    shift += "  ";
+  }
   level += 2;
 
   // name of variable identifying number of parameter in data
   TCollection_AsciiString param ( "num" );
-  if ( lev >0 ) param += TCollection_AsciiString ( lev );
+  if (lev > 0)
+  {
+    param += TCollection_AsciiString(lev);
+  }
   
   // decode aliased types
   Handle(Express_Type) type = vartype;
-  while ( type->IsKind(STANDARD_TYPE(Express_NamedType)) ) {
-    Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast ( type );
-    if ( ! named->Item()->IsKind(STANDARD_TYPE(Express_Alias)) ) break;
-    Handle(Express_Alias) alias = Handle(Express_Alias)::DownCast ( named->Item() );
+  while (type->IsKind(STANDARD_TYPE(Express_NamedType)))
+  {
+    Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast(type);
+    if (!named->Item()->IsKind(STANDARD_TYPE(Express_Alias)))
+    {
+      break;
+    }
+    Handle(Express_Alias) alias = Handle(Express_Alias)::DownCast(named->Item());
     type = alias->Type();
   }
-    
+
   // declare variable
-  if ( type->IsHandle() ) os << shift << "Handle(" << type->CPPName()->ToCString() << ") a";
-  else os << shift << type->CPPName()->ToCString() << " a";
+  if (type->IsHandle())
+  {
+    os << shift << "Handle(" << type->CPPName()->ToCString() << ") a";
+  }
+  else
+  {
+    os << shift << type->CPPName()->ToCString() << " a";
+  }
   os << varname << ";" << std::endl;
 
-  if ( optional ) {
+  if (optional)
+  {
     os << shift << "Standard_Boolean has" << varname << " = Standard_True;" << std::endl;
     os << shift << "if ( data->IsParamDefined (" << param << "," << index << ") ) {" << std::endl;
     shift += "  ";
@@ -717,118 +805,145 @@ static void WriteRWReadField (Standard_OStream &os,
   }
     
   // read variable depending on its type
-  if ( type->IsKind(STANDARD_TYPE(Express_NamedType)) ) {
-    Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast ( type );
-    if ( named->Item()->IsKind(STANDARD_TYPE(Express_Entity)) ) {
+  if (type->IsKind(STANDARD_TYPE(Express_NamedType)))
+  {
+    Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast(type);
+    if (named->Item()->IsKind(STANDARD_TYPE(Express_Entity)))
+    {
       os << shift << "data->ReadEntity (" << param << ", " << index << ", \"" << STEPName <<
-                    "\", ach, STANDARD_TYPE(" << named->CPPName()->ToCString() << "), a" << 
-                    varname << ");" << std::endl;
+        "\", ach, STANDARD_TYPE(" << named->CPPName()->ToCString() << "), a" <<
+        varname << ");" << std::endl;
     }
-    else if ( named->Item()->IsKind(STANDARD_TYPE(Express_Select)) ) {
+    else if (named->Item()->IsKind(STANDARD_TYPE(Express_Select)))
+    {
       os << shift << "data->ReadEntity (" << param << ", " << index << ", \"" << STEPName <<
-                    "\", ach, a" << varname << ");" << std::endl;
+        "\", ach, a" << varname << ");" << std::endl;
     }
-    else if ( named->Item()->IsKind(STANDARD_TYPE(Express_Enum)) ) {
-      os << shift << "if (data->ParamType (" << param << ", " << 
-                    index << ") == Interface_ParamEnum) {" << std::endl;
-      os << shift << "  Standard_CString text = data->ParamCValue(" << 
-                    param << ", " << index << ");" << std::endl;
-      Handle(Express_Enum) en = Handle(Express_Enum)::DownCast ( named->Item() );
+    else if (named->Item()->IsKind(STANDARD_TYPE(Express_Enum)))
+    {
+      os << shift << "if (data->ParamType (" << param << ", " <<
+        index << ") == Interface_ParamEnum) {" << std::endl;
+      os << shift << "  Standard_CString text = data->ParamCValue(" <<
+        param << ", " << index << ");" << std::endl;
+      Handle(Express_Enum) en = Handle(Express_Enum)::DownCast(named->Item());
       Handle(TCollection_HAsciiString) prefix = Express::EnumPrefix(en->Name());
       Handle(TColStd_HSequenceOfHAsciiString) names = en->Names();
       TCollection_AsciiString enpack = en->GetPackageName()->String();
-      for ( Standard_Integer i=1; i <= names->Length(); i++ ) {
-       Handle(TCollection_HAsciiString) ename = Express::ToStepName ( names->Value(i) );
-       ename->UpperCase();
-       os << shift << ( i==1 ? "  if     " : "  else if" ) << 
-                      " (strcmp(text, \"." << ename->ToCString() << ".\")) a" << 
-                      varname << " = " << enpack.ToCString() << "_" << prefix->ToCString()<<
-                      names->Value(i)->ToCString() << ";" << std::endl;
+      for (Standard_Integer i = 1; i <= names->Length(); i++)
+      {
+        Handle(TCollection_HAsciiString) ename = Express::ToStepName(names->Value(i));
+        ename->UpperCase();
+        os << shift << (i == 1 ? "  if     " : "  else if") <<
+          " (strcmp(text, \"." << ename->ToCString() << ".\")) a" <<
+          varname << " = " << enpack.ToCString() << "_" << prefix->ToCString() <<
+          names->Value(i)->ToCString() << ";" << std::endl;
       }
       os << shift << "  else ach->AddFail(\"Parameter #" << index << " (" <<
-                    STEPName << ") has not allowed value\");" << std::endl;
+        STEPName << ") has not allowed value\");" << std::endl;
       os << shift << "}" << std::endl;
       os << shift << "else ach->AddFail(\"Parameter #" << index << " (" <<
-                    STEPName << ") is not enumeration\");" << std::endl;
-//      os << "!!! READING/WRITING ENUM NOT IMPLEMENTED !!!" << std::endl;
-//      std::cout << "Warning: Reading/Writing ENUMERATION not yet implemented (" << 
-//     STEPName << ", " << varname << ", " << type->CPPName()->ToCString() << ")" << std::endl;
+        STEPName << ") is not enumeration\");" << std::endl;
+      //os << "!!! READING/WRITING ENUM NOT IMPLEMENTED !!!" << std::endl;
+      //std::cout << "Warning: Reading/Writing ENUMERATION not yet implemented (" << 
+      //STEPName << ", " << varname << ", " << type->CPPName()->ToCString() << ")" << std::endl;
     }
   }
-  else if ( type->IsKind(STANDARD_TYPE(Express_ComplexType)) ) {
-   
-    Handle(Express_ComplexType) complex = Handle(Express_ComplexType)::DownCast ( type );
+  else if (type->IsKind(STANDARD_TYPE(Express_ComplexType)))
+  {
+    Handle(Express_ComplexType) complex = Handle(Express_ComplexType)::DownCast(type);
     os << shift << "Standard_Integer sub" << index << " = 0;" << std::endl;
-    os << shift << "if ( data->ReadSubList (" << param << ", " << index << ", \"" << 
-                   STEPName << "\", ach, sub" << index << ") ) {" << std::endl;
+    os << shift << "if ( data->ReadSubList (" << param << ", " << index << ", \"" <<
+      STEPName << "\", ach, sub" << index << ") ) {" << std::endl;
     os << shift << "  Standard_Integer nb" << lev << " = data->NbParams(sub" << index << ");" << std::endl;
     TCollection_AsciiString iter = lev;
-    iter.Prepend ( "i" );
+    iter.Prepend("i");
     TCollection_AsciiString var = lev;
     var.Prepend("nIt");
-    if ( complex->Type()->IsKind(STANDARD_TYPE(Express_ComplexType)) ) { // array 2
-      Handle(Express_ComplexType) complex2 = Handle(Express_ComplexType)::DownCast ( complex->Type() );
+    if (complex->Type()->IsKind(STANDARD_TYPE(Express_ComplexType)))
+    { // array 2
+      Handle(Express_ComplexType) complex2 = Handle(Express_ComplexType)::DownCast(complex->Type());
       TCollection_AsciiString jter = lev;
-      jter.Prepend ( "j" );
-      os << shift << "  Standard_Integer nbj" << lev << " = data->NbParams(data->ParamNumber(sub" << index << ",1));" << std::endl;
-      os << shift << "  a" << varname << " = new " << type->CPPName()->ToCString() << " (1, nb" << lev << ", 1, nbj" << lev << ");" << std::endl;
-      os << shift << "  for ( Standard_Integer " << iter << "=1; " << iter << " <= nb" << lev << "; " << iter << "++ ) {" << std::endl;
+      jter.Prepend("j");
+      os << shift << "  Standard_Integer nbj" << lev <<
+        " = data->NbParams(data->ParamNumber(sub" << index << ",1));" << std::endl;
+      os << shift << "  a" << varname << " = new " << type->CPPName()->ToCString() <<
+        " (1, nb" << lev << ", 1, nbj" << lev << ");" << std::endl;
+      os << shift << "  for ( Standard_Integer " << iter << "=1; " << iter << " <= nb" << lev <<
+        "; " << iter << "++ ) {" << std::endl;
       os << shift << "    Standard_Integer subj" << index << " = 0;" << std::endl;
-      os << shift << "    if ( data->ReadSubList (sub" << index << ", " << iter << ", \"sub-part(" << 
-                     STEPName << ")\", ach, subj" << index << ") ) {" << std::endl;
-      os << shift << "      Standard_Integer num" << level+2 << " = subj" << index << ";" << std::endl;
-      os << shift << "      for ( Standard_Integer " << jter << "=1; " << jter << " <= nbj" << lev << "; " << jter << "++ ) {" << std::endl;
-      Handle(TCollection_HAsciiString) subName = TypeToSTEPName ( complex2->Type() );
-      WriteRWReadField (os, jter.ToCString(), subName->ToCString(), var.ToCString(), complex2->Type(), level+2, Standard_False );
-      os << shift << "        a" << varname << "->SetValue(" << iter << "," << jter << ", a" << var << ");" << std::endl;
+      os << shift << "    if ( data->ReadSubList (sub" << index << ", " << iter << ", \"sub-part(" <<
+        STEPName << ")\", ach, subj" << index << ") ) {" << std::endl;
+      os << shift << "      Standard_Integer num" << level + 2 << " = subj" << index << ";" << std::endl;
+      os << shift << "      for ( Standard_Integer " << jter << "=1; " << jter << " <= nbj" << lev <<
+        "; " << jter << "++ ) {" << std::endl;
+      Handle(TCollection_HAsciiString) subName = typeToSTEPName(complex2->Type());
+      WriteRWReadField(os, jter.ToCString(), subName->ToCString(), var.ToCString(),
+        complex2->Type(), level + 2, Standard_False);
+      os << shift << "        a" << varname << "->SetValue(" << iter << "," <<
+        jter << ", a" << var << ");" << std::endl;
       os << shift << "      }" << std::endl;
       os << shift << "    }" << std::endl;
-    } 
-    else { // simple array
-      os << shift << "  a" << varname << " = new " << type->CPPName()->ToCString() << " (1, nb" << lev << ");" << std::endl;
+    }
+    else
+    { // simple array
+      os << shift << "  a" << varname << " = new " << type->CPPName()->ToCString() <<
+        " (1, nb" << lev << ");" << std::endl;
       os << shift << "  Standard_Integer num" << level << " = sub" << index << ";" << std::endl;
-      os << shift << "  for ( Standard_Integer " << iter << "=1; " << iter << " <= nb" << lev << "; " << iter << "++ ) {" << std::endl;
-      Handle(TCollection_HAsciiString) subName = TypeToSTEPName ( complex->Type() );
-      WriteRWReadField (os, iter.ToCString(), subName->ToCString(), var.ToCString(), complex->Type(), level, Standard_False );
+      os << shift << "  for ( Standard_Integer " << iter << "=1; " << iter << " <= nb" << lev <<
+        "; " << iter << "++ ) {" << std::endl;
+      Handle(TCollection_HAsciiString) subName = typeToSTEPName(complex->Type());
+      WriteRWReadField(os, iter.ToCString(), subName->ToCString(), var.ToCString(),
+        complex->Type(), level, Standard_False);
       os << shift << "    a" << varname << "->SetValue(" << iter << ", a" << var << ");" << std::endl;
     }
     os << shift << "  }" << std::endl;
     os << shift << "}" << std::endl;
   }
-  else if ( type->IsKind(STANDARD_TYPE(Express_String)) ) {
+  else if (type->IsKind(STANDARD_TYPE(Express_String)))
+  {
     os << shift << "data->ReadString (" << param << ", " << index << ", \"" << STEPName <<
-                   "\", ach, a" << varname << ");" << std::endl;
+      "\", ach, a" << varname << ");" << std::endl;
   }
-  else if ( type->IsKind(STANDARD_TYPE(Express_Logical)) ) {
+  else if (type->IsKind(STANDARD_TYPE(Express_Logical)))
+  {
     os << shift << "data->ReadLogical (" << param << ", " << index << ", \"" << STEPName <<
-                   "\", ach, a" << varname << ");" << std::endl;
+      "\", ach, a" << varname << ");" << std::endl;
   }
-  else if ( type->IsKind(STANDARD_TYPE(Express_Boolean)) ) {
+  else if (type->IsKind(STANDARD_TYPE(Express_Boolean)))
+  {
     os << shift << "data->ReadBoolean (" << param << ", " << index << ", \"" << STEPName <<
-                   "\", ach, a" << varname << ");" << std::endl;
+      "\", ach, a" << varname << ");" << std::endl;
   }
-  else if ( type->IsKind(STANDARD_TYPE(Express_Number)) ||
-           type->IsKind(STANDARD_TYPE(Express_Integer)) ) {
+  else if (type->IsKind(STANDARD_TYPE(Express_Number)) || type->IsKind(STANDARD_TYPE(Express_Integer)))
+  {
     os << shift << "data->ReadInteger (" << param << ", " << index << ", \"" << STEPName <<
-                   "\", ach, a" << varname << ");" << std::endl;
+      "\", ach, a" << varname << ");" << std::endl;
   }
-  else if ( type->IsKind(STANDARD_TYPE(Express_Real)) ) {
+  else if (type->IsKind(STANDARD_TYPE(Express_Real)))
+  {
     os << shift << "data->ReadReal (" << param << ", " << index << ", \"" << STEPName <<
-                   "\", ach, a" << varname << ");" << std::endl;
+      "\", ach, a" << varname << ");" << std::endl;
   }
 
-  if ( optional ) {
-    shift.Remove ( 1, 2 );
+  if (optional)
+  {
+    shift.Remove(1, 2);
     os << shift << "}" << std::endl;
     os << shift << "else {" << std::endl;
     os << shift << "  has" << varname << " = Standard_False;" << std::endl;
     os << shift << "  a" << varname;
     if (type->IsHandle())
+    {
       os << ".Nullify();";
+    }
     else if (type->IsStandard())
+    {
       os << " = 0;";
+    }
     else
+    {
       os << " = " << type->CPPName()->ToCString() << "();";
+    }
     os << std::endl;
     os << shift << "}" << std::endl;
   }
@@ -846,22 +961,31 @@ Standard_Integer Express_Entity::WriteRWReadCode (Standard_OStream &os,
   Standard_Integer num = start;
   
   // write code for reading inherited fields
-  for ( Standard_Integer i=1; i <= myInherit->Length(); i++ ) 
-    num = myInherit->Value(i)->WriteRWReadCode ( os, num, Standard_False );
+  for (Standard_Integer i = 1; i <= myInherit->Length(); i++)
+  {
+    num = myInherit->Value(i)->WriteRWReadCode(os, num, Standard_False);
+  }
 
   // write code for reading own fields
-  if ( myFields->Length() >0 ) {
+  if ( myFields->Length() >0 )
+  {
     if ( num >0 ) os << std::endl;
     os << "  // " << ( own ? "Own" : "Inherited" ) << " fields of " << Name()->ToCString() << std::endl;
   }
   
-  for (Standard_Integer i = 1; i <= myFields->Length(); i++) {
+  for (Standard_Integer i = 1; i <= myFields->Length(); i++)
+  {
     Handle(Express_Field) field = myFields->Value(i);
     Handle(TCollection_HAsciiString) STEPName = Express::ToStepName(field->Name());
-    if (!own) STEPName->Prepend(Express::ToStepName(Name()->Cat(".")));
+    if (!own)
+    {
+      STEPName->Prepend(Express::ToStepName(Name()->Cat(".")));
+    }
     Handle(TCollection_HAsciiString) varName = new TCollection_HAsciiString(field->Name());
-    if (!own) varName->Prepend(Name()->Cat("_"));
-
+    if (!own)
+    {
+      varName->Prepend(Name()->Cat("_"));
+    }
     os << std::endl;
     WriteRWReadField(os, TCollection_AsciiString(num).ToCString(), STEPName->ToCString(),
       varName->ToCString(), field->Type(), 0, field->IsOptional());
@@ -875,89 +999,106 @@ Standard_Integer Express_Entity::WriteRWReadCode (Standard_OStream &os,
 //purpose  : 
 //=======================================================================
 
-static void WriteRWWriteField (Standard_OStream &os, 
-                              const Standard_CString varname,
-                              const Handle(Express_Type) &vartype, 
-                              const Standard_Integer index,
-                              const Standard_Integer lev)
+static void WriteRWWriteField(
+  Standard_OStream &os,
+  const Standard_CString varname,
+  const Handle(Express_Type) &vartype,
+  const Standard_Integer index,
+  const Standard_Integer lev)
 {
   // indent
   TCollection_AsciiString shift ( "  " );
   Standard_Integer level = 0;
-  for (; level < lev; level++ ) shift += "  ";
+  for (; level < lev; level++)
+  {
+    shift += "  ";
+  }
   level++;
 
   // decode aliased types
   Handle(Express_Type) type = vartype;
-  while ( type->IsKind(STANDARD_TYPE(Express_NamedType)) ) {
-    Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast ( type );
-    if ( ! named->Item()->IsKind(STANDARD_TYPE(Express_Alias)) ) break;
-    Handle(Express_Alias) alias = Handle(Express_Alias)::DownCast ( named->Item() );
+  while (type->IsKind(STANDARD_TYPE(Express_NamedType)))
+  {
+    Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast(type);
+    if (!named->Item()->IsKind(STANDARD_TYPE(Express_Alias)))
+    {
+      break;
+    }
+    Handle(Express_Alias) alias = Handle(Express_Alias)::DownCast(named->Item());
     type = alias->Type();
   }
-    
+
   // write variable depending on its type
-  if ( type->IsKind(STANDARD_TYPE(Express_ComplexType)) ) {
-    
-    Handle(Express_ComplexType) complex = Handle(Express_ComplexType)::DownCast ( type );
+  if (type->IsKind(STANDARD_TYPE(Express_ComplexType)))
+  {
+    Handle(Express_ComplexType) complex = Handle(Express_ComplexType)::DownCast(type);
     type = complex->Type();
-    TCollection_AsciiString var ( lev );
-    var.Prepend ( "Var" );
+    TCollection_AsciiString var(lev);
+    var.Prepend("Var");
     os << shift << "SW.OpenSub();" << std::endl;
     os << shift << "for (Standard_Integer i" << index << "=1; i" << index << " <= ";
-    if ( type->IsKind(STANDARD_TYPE(Express_ComplexType)) ) { // array 2 
-      Handle(Express_ComplexType) complex2 = Handle(Express_ComplexType)::DownCast ( type );
+    if (type->IsKind(STANDARD_TYPE(Express_ComplexType)))
+    { // array 2 
+      Handle(Express_ComplexType) complex2 = Handle(Express_ComplexType)::DownCast(type);
       type = complex2->Type();
       os << varname << "->RowLength(); i" << index << "++ ) {" << std::endl;
       os << shift << "  SW.NewLine(Standard_False);" << std::endl;
       os << shift << "  SW.OpenSub();" << std::endl;
       os << shift << "  for (Standard_Integer j" << index << "=1; j" << index << " <= " <<
-            varname << "->ColLength(); j" << index << "++ ) {" << std::endl;
-      os << shift << "  " << ( type->IsHandle() ? "  Handle(" : "  " ) << type->CPPName()->ToCString() <<
-                             ( type->IsHandle() ? ") " : " " ) << var.ToCString() << " = " <<
-                 varname << "->Value(i" << index << ",j" << index << ");" << std::endl;
-      WriteRWWriteField (os, var.ToCString(), type, index+1, level+1 );
+        varname << "->ColLength(); j" << index << "++ ) {" << std::endl;
+      os << shift << "  " << (type->IsHandle() ? "  Handle(" : "  ") << type->CPPName()->ToCString() <<
+        (type->IsHandle() ? ") " : " ") << var.ToCString() << " = " <<
+        varname << "->Value(i" << index << ",j" << index << ");" << std::endl;
+      WriteRWWriteField(os, var.ToCString(), type, index + 1, level + 1);
       os << shift << "  }" << std::endl;
       os << shift << "  SW.CloseSub();" << std::endl;
-    } 
-    else { // simple array
+    }
+    else
+    { // simple array
       os << varname << "->Length(); i" << index << "++ ) {" << std::endl;
-      os << shift << ( type->IsHandle() ? "  Handle(" : "  " ) << type->CPPName()->ToCString() <<
-                     ( type->IsHandle() ? ") " : " " ) << var.ToCString() << " = " <<
-                    varname << "->Value(i" << index << ");" << std::endl;
-      WriteRWWriteField (os, var.ToCString(), type, index+1, level );
+      os << shift << (type->IsHandle() ? "  Handle(" : "  ") << type->CPPName()->ToCString() <<
+        (type->IsHandle() ? ") " : " ") << var.ToCString() << " = " <<
+        varname << "->Value(i" << index << ");" << std::endl;
+      WriteRWWriteField(os, var.ToCString(), type, index + 1, level);
     }
     os << shift << "}" << std::endl;
     os << shift << "SW.CloseSub();" << std::endl;
   }
-  else if ( type->IsKind(STANDARD_TYPE(Express_Boolean)) ) {
+  else if (type->IsKind(STANDARD_TYPE(Express_Boolean)))
+  {
     os << shift << "SW.SendBoolean (" << varname << ");" << std::endl;
   }
-  else if ( type->IsKind(STANDARD_TYPE(Express_Logical)) ) {
+  else if (type->IsKind(STANDARD_TYPE(Express_Logical)))
+  {
     os << shift << "SW.SendLogical (" << varname << ");" << std::endl;
   }
-  else {
-    Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast ( type );
-    if ( ! named.IsNull() && named->Item()->IsKind(STANDARD_TYPE(Express_Enum)) ) {
-      Handle(Express_Enum) en = Handle(Express_Enum)::DownCast ( named->Item() );
+  else
+  {
+    Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast(type);
+    if (!named.IsNull() && named->Item()->IsKind(STANDARD_TYPE(Express_Enum)))
+    {
+      Handle(Express_Enum) en = Handle(Express_Enum)::DownCast(named->Item());
       Handle(TCollection_HAsciiString) prefix = Express::EnumPrefix(en->Name());
-      
       Handle(TColStd_HSequenceOfHAsciiString) names = en->Names();
       TCollection_AsciiString enpack = en->GetPackageName()->String();
       os << shift << "switch (" << varname << ") {" << std::endl;
-      for ( Standard_Integer i=1; i <= names->Length(); i++ ) {
-       Handle(TCollection_HAsciiString) ename = Express::ToStepName ( names->Value(i) );
-       ename->UpperCase();
-       os << shift << "  case " << enpack.ToCString() << "_" << prefix->ToCString()<<
-                      names->Value(i)->ToCString() << ": SW.SendEnum (\"." << 
-                      ename->ToCString() << ".\"); break;" << std::endl;
+      for (Standard_Integer i = 1; i <= names->Length(); i++)
+      {
+        Handle(TCollection_HAsciiString) ename = Express::ToStepName(names->Value(i));
+        ename->UpperCase();
+        os << shift << "  case " << enpack.ToCString() << "_" << prefix->ToCString() <<
+          names->Value(i)->ToCString() << ": SW.SendEnum (\"." <<
+          ename->ToCString() << ".\"); break;" << std::endl;
       }
       os << shift << "}" << std::endl;
     }
-    else {
+    else
+    {
       os << shift << "SW.Send (" << varname;
-      if ( ! named.IsNull() && named->Item()->IsKind(STANDARD_TYPE(Express_Select)) ) 
-       os << ".Value()";
+      if (!named.IsNull() && named->Item()->IsKind(STANDARD_TYPE(Express_Select)))
+      {
+        os << ".Value()";
+      }
       os << ");" << std::endl;
     }
   }
@@ -968,46 +1109,63 @@ static void WriteRWWriteField (Standard_OStream &os,
 //purpose  : 
 //=======================================================================
 
-Standard_Integer Express_Entity::WriteRWWriteCode (Standard_OStream &os, 
-                                                   const Standard_Integer start,
-                                                   const Standard_Integer own) const
+Standard_Integer Express_Entity::WriteRWWriteCode(
+  Standard_OStream &os,
+  const Standard_Integer start,
+  const Standard_Integer own) const
 {
   Standard_Integer num = start;
   
   // write code for writing inherited fields
-  for ( Standard_Integer i=1; i <= myInherit->Length(); i++ ) 
-    num = myInherit->Value(i)->WriteRWWriteCode ( os, num, ( i >1 ? -1 : 1 ) );
+  for (Standard_Integer i = 1; i <= myInherit->Length(); i++)
+  {
+    num = myInherit->Value(i)->WriteRWWriteCode(os, num, (i > 1 ? -1 : 1));
+  }
 
   // write code for writing own fields
-  if ( myFields->Length() >0 ) {
+  if (myFields->Length() > 0)
+  {
     os << std::endl;
     os << "  // " << ( own == 1 ? "Own" : "Inherited" ) << " fields of " << Name()->ToCString() << std::endl;
   }
   
-  for (Standard_Integer i=1; i <= myFields->Length(); i++ ) {
+  for (Standard_Integer i=1; i <= myFields->Length(); i++ )
+  {
     Handle(Express_Field) field = myFields->Value(i);
     TCollection_AsciiString varName ( field->Name()->String() );
-    if ( ! own ) varName.Prepend ( CPPName()->Cat ( "::" )->String() );
-    else if ( own ==-1 ) { // inherited base class implemented as field
+    if (!own)
+    {
+      varName.Prepend(CPPName()->Cat("::")->String());
+    }
+    else if (own == -1)
+    { // inherited base class implemented as field
       varName.Prepend ( Name()->Cat ( "()->" )->String() );
     }
     varName.Prepend ( "ent->" );
     varName.AssignCat ( "()" );
     os << std::endl;
     
-    if ( field->IsOptional() ) {
+    if (field->IsOptional())
+    {
       os << "  if ( ent->";
-      if ( ! own ) os << CPPName()->ToCString() << "::";
-      else if ( own ==-1 ) os << Name()->ToCString() << "()->";
+      if (!own)
+      {
+        os << CPPName()->ToCString() << "::";
+      }
+      else if (own == -1)
+      {
+        os << Name()->ToCString() << "()->";
+      }
       os << "Has" << field->Name()->ToCString() << "() ) {" << std::endl;
     }
-    WriteRWWriteField ( os, varName.ToCString(), field->Type(), num, ( field->IsOptional() ? 1 : 0 ) );
-    if ( field->IsOptional() ) {
+    WriteRWWriteField(os, varName.ToCString(), field->Type(), num, (field->IsOptional() ? 1 : 0));
+    if (field->IsOptional())
+    {
       os << "  }\n  else SW.SendUndef();" << std::endl;
     }
     num++;
   }
-  
+
   return num;
 }
 
@@ -1016,53 +1174,67 @@ Standard_Integer Express_Entity::WriteRWWriteCode (Standard_OStream &os,
 //purpose  : 
 //=======================================================================
 
-static Standard_Boolean WriteRWShareField (Standard_OStream &os, 
-                                          const Standard_CString varname,
-                                          const Handle(Express_Type) &vartype, 
-                                          const Standard_Integer index,
-                                          const Standard_Integer lev)
+static Standard_Boolean WriteRWShareField(
+  Standard_OStream &os,
+  const Standard_CString varname,
+  const Handle(Express_Type) &vartype,
+  const Standard_Integer index,
+  const Standard_Integer lev)
 {
   // indent
-  TCollection_AsciiString shift ( "  " );
+  TCollection_AsciiString shift("  ");
   Standard_Integer level = 0;
-  for (; level < lev; level++ ) shift += "  ";
+  for (; level < lev; level++)
+  {
+    shift += "  ";
+  }
   level++;
 
   // decode aliased types
   Handle(Express_Type) type = vartype;
-  while ( type->IsKind(STANDARD_TYPE(Express_NamedType)) ) {
-    Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast ( type );
-    if ( ! named->Item()->IsKind(STANDARD_TYPE(Express_Alias)) ) break;
-    Handle(Express_Alias) alias = Handle(Express_Alias)::DownCast ( named->Item() );
+  while (type->IsKind(STANDARD_TYPE(Express_NamedType)))
+  {
+    Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast(type);
+    if (!named->Item()->IsKind(STANDARD_TYPE(Express_Alias)))
+    {
+      break;
+    }
+    Handle(Express_Alias) alias = Handle(Express_Alias)::DownCast(named->Item());
     type = alias->Type();
   }
-    
+
   // write variable depending on its type
-  if ( type->IsKind(STANDARD_TYPE(Express_ComplexType)) ) {
-    Handle(Express_ComplexType) complex = Handle(Express_ComplexType)::DownCast ( type );
+  if (type->IsKind(STANDARD_TYPE(Express_ComplexType)))
+  {
+    Handle(Express_ComplexType) complex = Handle(Express_ComplexType)::DownCast(type);
     type = complex->Type();
-    TCollection_AsciiString var ( lev );
-    var.Prepend ( "Var" );
+    TCollection_AsciiString var(lev);
+    var.Prepend("Var");
     std::ostringstream oos;
-    if ( ! WriteRWShareField (oos, var.ToCString(), type, index + 1, level ) ) 
+    if (!WriteRWShareField(oos, var.ToCString(), type, index + 1, level))
+    {
       return Standard_False;
-    os << shift << "for (Standard_Integer i" << index << "=1; i" << index << " <= " << 
-                    varname << "->Length(); i" << index << "++ ) {" << std::endl;
-    os << shift << ( type->IsHandle() ? "  Handle(" : "  " ) << type->CPPName()->ToCString() <<
-                   ( type->IsHandle() ? ") " : " " ) << var.ToCString() << " = " <<
-                  varname << "->Value(i" << index << ");" << std::endl;
+    }
+    os << shift << "for (Standard_Integer i" << index << "=1; i" << index << " <= " <<
+      varname << "->Length(); i" << index << "++ ) {" << std::endl;
+    os << shift << (type->IsHandle() ? "  Handle(" : "  ") << type->CPPName()->ToCString() <<
+      (type->IsHandle() ? ") " : " ") << var.ToCString() << " = " <<
+      varname << "->Value(i" << index << ");" << std::endl;
 
     os << oos.str();
     os << shift << "}" << std::endl;
     return Standard_True;
   }
-  if ( type->IsKind(STANDARD_TYPE(Express_NamedType)) ) {
-    Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast ( type );
-    if ( named->Item()->IsKind(STANDARD_TYPE(Express_Entity)) ) {
+  if (type->IsKind(STANDARD_TYPE(Express_NamedType)))
+  {
+    Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast(type);
+    if (named->Item()->IsKind(STANDARD_TYPE(Express_Entity)))
+    {
       os << shift << "iter.AddItem (" << varname << ");" << std::endl;
       return Standard_True;
     }
-    if ( named->Item()->IsKind(STANDARD_TYPE(Express_Select)) ) {
+    if (named->Item()->IsKind(STANDARD_TYPE(Express_Select)))
+    {
       os << shift << "iter.AddItem (" << varname << ".Value());" << std::endl;
       return Standard_True;
     }
@@ -1075,38 +1247,50 @@ static Standard_Boolean WriteRWShareField (Standard_OStream &os,
 //purpose  : 
 //=======================================================================
 
-Standard_Integer Express_Entity::WriteRWShareCode (Standard_OStream &os, 
-                                                   const Standard_Integer start,
-                                                   const Standard_Integer own) const
+Standard_Integer Express_Entity::WriteRWShareCode(
+  Standard_OStream &os,
+  const Standard_Integer start,
+  const Standard_Integer own) const
 {
   Standard_Integer num = start;
   
   // write code for sharing inherited fields
-  for ( Standard_Integer i=1; i <= myInherit->Length(); i++ ) 
-    num = myInherit->Value(i)->WriteRWShareCode ( os, num, ( i >1 ? -1 : Standard_False ) );
+  for (Standard_Integer i = 1; i <= myInherit->Length(); i++)
+  {
+    num = myInherit->Value(i)->WriteRWShareCode(os, num, (i > 1 ? -1 : Standard_False));
+  }
 
   // write code for sharing own fields
-  if ( myFields->Length() >0 ) {
+  if ( myFields->Length() >0 )
+  {
     os << std::endl;
     os << "  // " << ( own == 1 ? "Own" : "Inherited" ) << " fields of " << Name()->ToCString() << std::endl;
   }
   
-  for (Standard_Integer i=1; i <= myFields->Length(); i++ ) {
+  for (Standard_Integer i=1; i <= myFields->Length(); i++ )
+  {
     Handle(Express_Field) field = myFields->Value(i);
     TCollection_AsciiString varName ( field->Name()->String() );
-    if ( ! own ) varName.Prepend ( CPPName()->Cat ( "::" )->String() );
-    else if ( own ==-1 ) { // inherited base class implemented as field
+    if (!own)
+    {
+      varName.Prepend(CPPName()->Cat("::")->String());
+    }
+    else if ( own ==-1 )
+    { // inherited base class implemented as field
       varName.Prepend ( Name()->Cat ( "()->" )->String() );
     }
     varName.Prepend ( "ent->" );
     varName.AssignCat ( "()" );
     
     std::ostringstream oos;
-    if ( ! WriteRWShareField ( oos, varName.ToCString(), field->Type(), num,
-                              ( field->IsOptional() ? 1 : 0 ) ) ) continue;
+    if (!WriteRWShareField(oos, varName.ToCString(), field->Type(), num, (field->IsOptional() ? 1 : 0)))
+    {
+      continue;
+    }
     num++;
     os << std::endl;
-    if ( field->IsOptional() ) {
+    if (field->IsOptional())
+    {
       os << "  if ( ent->";
       if ( ! own ) os << CPPName()->ToCString() << "::";
       else if ( own ==-1 ) os << Name()->ToCString() << "()->";
@@ -1114,7 +1298,8 @@ Standard_Integer Express_Entity::WriteRWShareCode (Standard_OStream &os,
     }
 
     os << oos.str();
-    if ( field->IsOptional() ) {
+    if (field->IsOptional())
+    {
       os << "  }" << std::endl;
     }
   }
@@ -1134,78 +1319,124 @@ Standard_Integer Express_Entity::MakeInit (Standard_OStream &os,
   Standard_Integer sh = shift;
   
   // write code for inherited fields
-  for (Standard_Integer i = 1; i <= myInherit->Length(); i++) {
+  for (Standard_Integer i = 1; i <= myInherit->Length(); i++)
+  {
     Handle(Express_Entity) ent = myInherit->Value(i);
-    if (mode == 3) {
+    if (mode == 3)
+    {
       Standard_Integer s = 0;
-      if (i > 1) {
+      if (i > 1)
+      {
         os << "\n  my" << ent->Name()->ToCString() << " = new " << ent->CPPName()->ToCString() << ";";
         os << "\n  my" << ent->Name()->ToCString() << "->Init(";
         s = 12 + ent->Name()->Length();
       }
-      else {
+      else
+      {
         os << "\n  " << ent->CPPName()->ToCString() << "::Init(";
         s = 9 + ent->CPPName()->Length();
       }
       ent->MakeInit(os, s, Standard_False, 2);
       os << ");";
     }
-    else sh = ent->MakeInit(os, sh, (i > 1 ? -1 : Standard_False), mode);
+    else
+    {
+      sh = ent->MakeInit(os, sh, (i > 1 ? -1 : Standard_False), mode);
+    }
   }
 
   // write code for own fields
-  
-  for (Standard_Integer i=1; i <= myFields->Length(); i++ ) {
+
+  for (Standard_Integer i = 1; i <= myFields->Length(); i++)
+  {
     Handle(Express_Field) field = myFields->Value(i);
-    Handle(TCollection_HAsciiString) varName = new TCollection_HAsciiString ( field->Name() );
-    if ( own != 1 ) varName->Prepend ( Name()->Cat ( "_" ) );
+    Handle(TCollection_HAsciiString) varName = new TCollection_HAsciiString(field->Name());
+    if (own != 1)
+    {
+      varName->Prepend(Name()->Cat("_"));
+    }
 
     // make CR and indent
     TCollection_AsciiString space = "";
-    for ( Standard_Integer sn=0; sn < abs(sh); sn++ ) space += " ";
-    Standard_Character delim = ( mode == 0 ? ',' : ( mode == 3 ? '\n' : ',' ) );
-    if ( sh < 0 ) os << delim << "\n" << space;
-    else sh = -sh;
-    
-    if ( field->IsOptional() ) {
-      if ( mode == 0 ) os << "const Standard_Boolean has" << varName->ToCString() << ",\n" << space;
-      else if ( mode == 1 ) os << "const Standard_Boolean has" << varName->ToCString() << ",\n" << space;
-      else if ( mode == 2 || mode == 4) os << "has" << varName->ToCString() << ",\n" << space;
+    for (Standard_Integer sn = 0; sn < abs(sh); sn++)
+    {
+      space += " ";
     }
-    
+    Standard_Character delim = (mode == 0 ? ',' : (mode == 3 ? '\n' : ','));
+    if (sh < 0)
+    {
+      os << delim << "\n" << space;
+    }
+    else
+    {
+      sh = -sh;
+    }
+
+    if (field->IsOptional())
+    {
+      if (mode == 0)
+      {
+        os << "const Standard_Boolean has" << varName->ToCString() << ",\n" << space;
+      }
+      else if (mode == 1)
+      {
+        os << "const Standard_Boolean has" << varName->ToCString() << ",\n" << space;
+      }
+      else if (mode == 2 || mode == 4)
+      {
+        os << "has" << varName->ToCString() << ",\n" << space;
+      }
+    }
+
     // write field
-    if ( mode == 0 || mode ==1) {
+    if (mode == 0 || mode == 1)
+    {
       os << "const " << (field->Type()->IsHandle() ? "Handle(" : "") <<
         field->Type()->CPPName()->ToCString() << (field->Type()->IsHandle() ? ")" : "") <<
         (field->Type()->IsSimple() ? " the" : "& the") << varName->ToCString();
     }
-    else if ( mode == 2 ) {
+    else if (mode == 2)
+    {
       os << "the" << varName->ToCString();
     }
-    else if (mode == 4) {
+    else if (mode == 4)
+    {
       os << "a" << varName->ToCString();
     }
-    else {
-      if (field->IsOptional()) {
+    else
+    {
+      if (field->IsOptional())
+      {
         os << "def" << field->Name()->ToCString() << " = has" << varName->ToCString() << ";" << std::endl;
         os << "  if (def" << field->Name()->ToCString() << ") {\n    ";
       }
       os << "my" << field->Name()->ToCString() << " = the" << varName->ToCString() << ";";
-      if (field->IsOptional()) {
+      if (field->IsOptional())
+      {
         os << "\n  }\n  else my" << field->Name()->ToCString();
         if (field->Type()->IsHandle())
+        {
           os << ".Nullify();";
+        }
         else if (field->Type()->IsStandard())
+        {
           os << " = 0;";
+        }
         else
+        {
           os << " = " << field->Type()->CPPName()->ToCString() << "();";
+        }
       }
     }
-    if ( sh >0 ) sh = -sh;
+    if (sh > 0)
+    {
+      sh = -sh;
+    }
   }
-  
+
   return sh;
 }
+
 //=======================================================================
 //function : SetAbstractFlag
 //purpose  : 
index 20ba8d24250ea37472667bf084e634a2c1d616b1..0fa231ee5c5faf7e4e6e4e45c8f4323e6e12dee2 100644 (file)
@@ -25,7 +25,6 @@ class Express_HSequenceOfEntity;
 class Express_HSequenceOfField;
 class Dico_DictionaryOfInteger;
 
-
 //! Implements ENTITY item of the EXPRESS
 //! schema, with interface for deferred Item class.
 class Express_Entity : public Express_Item
@@ -33,11 +32,13 @@ class Express_Entity : public Express_Item
 
 public:
 
-  
   //! Create ENTITY item and initialize it
   //! flags hasCheck and hasFillShared mark if generated class has
   //! methods Check and FillShared cprrespondingly.
-  Standard_EXPORT Express_Entity(const Standard_CString name, const Handle(TColStd_HSequenceOfHAsciiString)& inherit, const Handle(Express_HSequenceOfField)& flds);
+  Standard_EXPORT Express_Entity(
+    const Standard_CString name,
+    const Handle(TColStd_HSequenceOfHAsciiString)& inherit,
+    const Handle(Express_HSequenceOfField)& flds);
   
   //! Returns sequence of inherited classes (names)
   Standard_EXPORT  const  Handle(TColStd_HSequenceOfHAsciiString)& SuperTypes()  const;
@@ -58,16 +59,10 @@ public:
   //! Returns abstract flag.
   Standard_EXPORT   Standard_Boolean AbstractFlag()  const;
 
-
-
-
   DEFINE_STANDARD_RTTIEXT(Express_Entity,Express_Item)
 
 protected:
 
-
-
-
 private: 
 
   typedef NCollection_DataMap<TCollection_AsciiString,Standard_Integer,TCollection_AsciiString> DataMapOfStringInteger;
@@ -82,13 +77,22 @@ private:
   Standard_EXPORT   void WriteRWInclude (Standard_OStream& os, DataMapOfStringInteger& dict)  const;
   
   //! Writes code for reading all fields
-  Standard_EXPORT   Standard_Integer WriteRWReadCode (Standard_OStream& os, const Standard_Integer start, const Standard_Integer own)  const;
+  Standard_EXPORT   Standard_Integer WriteRWReadCode(
+    Standard_OStream& os,
+    const Standard_Integer start,
+    const Standard_Integer own)  const;
   
   //! Writes code for writing all fields
-  Standard_EXPORT   Standard_Integer WriteRWWriteCode (Standard_OStream& os, const Standard_Integer start, const Standard_Integer own)  const;
+  Standard_EXPORT   Standard_Integer WriteRWWriteCode(
+    Standard_OStream& os,
+    const Standard_Integer start,
+    const Standard_Integer own)  const;
   
   //! Writes code for adding shared entities to the graph
-  Standard_EXPORT   Standard_Integer WriteRWShareCode (Standard_OStream& os, const Standard_Integer start, const Standard_Integer own)  const;
+  Standard_EXPORT   Standard_Integer WriteRWShareCode(
+    Standard_OStream& os,
+    const Standard_Integer start,
+    const Standard_Integer own)  const;
   
   //! Writes arguments and code for method Init()
   //! Mode identifyes what code is being written:
@@ -97,7 +101,11 @@ private:
   //! 2 - call (argument list)
   //! 3 - implementation
   //! 4 - call (argument list for RW)
-  Standard_EXPORT   Standard_Integer MakeInit (Standard_OStream& os, const Standard_Integer shift, const Standard_Integer own, const Standard_Integer mode)  const;
+  Standard_EXPORT   Standard_Integer MakeInit(
+    Standard_OStream& os,
+    const Standard_Integer shift,
+    const Standard_Integer own,
+    const Standard_Integer mode)  const;
 
   Handle(TColStd_HSequenceOfHAsciiString) mySupers;
   Handle(Express_HSequenceOfEntity) myInherit;
@@ -105,10 +113,4 @@ private:
   Standard_Boolean myisAbstract;
 };
 
-
-
-
-
-
-
 #endif // _Express_Entity_HeaderFile
index 76d64c21a88a029eeddeee30ad611d9989eeb95a..73d831c1f293924de96bb04c53da934431148bc5 100644 (file)
@@ -27,9 +27,10 @@ IMPLEMENT_STANDARD_RTTIEXT(Express_Enum,Express_Item)
 //purpose  : 
 //=======================================================================
 
-Express_Enum::Express_Enum (const Standard_CString name, 
-                             const Handle(TColStd_HSequenceOfHAsciiString) &names)
-     : Express_Item(name), myNames(names)
+Express_Enum::Express_Enum(
+  const Standard_CString name,
+  const Handle(TColStd_HSequenceOfHAsciiString) &names)
+  : Express_Item(name), myNames(names)
 {
 }
 
@@ -51,18 +52,18 @@ const Handle(TColStd_HSequenceOfHAsciiString) &Express_Enum::Names () const
 Standard_Boolean Express_Enum::GenerateClass () const
 {
   std::cout << "Generating ENUMERATION " << CPPName()->ToCString() << std::endl;
-  
+
   // create a package directory (if not yet exist)
-  OSD_Protection prot ( OSD_RX, OSD_RWX, OSD_RX, OSD_RX );
+  OSD_Protection prot(OSD_RX, OSD_RWX, OSD_RX, OSD_RX);
   TCollection_AsciiString pack = GetPackageName()->String();
-  OSD_Path path ( pack );
-  OSD_Directory dir ( path );
-  dir.Build ( prot );
+  OSD_Path path(pack);
+  OSD_Directory dir(path);
+  dir.Build(prot);
   pack += "/";
   pack += CPPName()->String();
-  
+
   // Open HXX file 
-  std::ofstream os ( pack.Cat ( ".hxx" ).ToCString(), std::ios::out | std::ios::ate );
+  std::ofstream os(pack.Cat(".hxx").ToCString(), std::ios::out | std::ios::ate);
 
   // write header
   Express::WriteFileStamp(os);
@@ -74,15 +75,19 @@ Standard_Boolean Express_Enum::GenerateClass () const
   os << std::endl << "enum " << CPPName()->ToCString() << std::endl;
   os << "{" << std::endl;
   Handle(TCollection_HAsciiString) prefix = Express::EnumPrefix(Name());
-  for ( Standard_Integer i = 1; i <= myNames->Length(); i++ ) {
-    if ( i > 1 ) os << "," << std::endl;
-    os << "  " <<  GetPackageName()->ToCString() << "_" << prefix->ToCString()
-       << myNames->Value(i)->ToCString();
+  for (Standard_Integer i = 1; i <= myNames->Length(); i++)
+  {
+    if (i > 1)
+    {
+      os << "," << std::endl;
+    }
+    os << "  " << GetPackageName()->ToCString() << "_" << prefix->ToCString()
+      << myNames->Value(i)->ToCString();
   }
 
   os << std::endl << "};" << std::endl;
   os << "#endif // _" << CPPName()->ToCString() << "_HeaderFile" << std::endl;
   os.close();
-  
+
   return Standard_False;
 }
index fde36c480819c743934f02664688eca0419bfb53..51ff17da299f4be038d6f68b9f8d37f7ae70c547 100644 (file)
 #include <Express_Item.hxx>
 #include <TColStd_HSequenceOfHAsciiString.hxx>
 
-
 //! Implements TYPE ENUMERATION item of the EXPRESS
 //! schema, with interface for deferred Item class.
 class Express_Enum : public Express_Item
 {
 
 public:
-
   
   //! Create ENUM item and initialize it
   Standard_EXPORT Express_Enum(const Standard_CString name, const Handle(TColStd_HSequenceOfHAsciiString)& names);
@@ -37,28 +35,14 @@ public:
   //! Create HXX/CXX files from item
   Standard_EXPORT virtual   Standard_Boolean GenerateClass()  const Standard_OVERRIDE;
 
-
-
-
   DEFINE_STANDARD_RTTIEXT(Express_Enum,Express_Item)
 
 protected:
 
-
-
-
 private: 
 
-
   Handle(TColStd_HSequenceOfHAsciiString) myNames;
 
-
 };
 
-
-
-
-
-
-
 #endif // _Express_Enum_HeaderFile
index 584a67fb34743ee797527d48ad1a7d64e50aa173..981fa1bfd240664dce1de7ac7302069026f7e9b6 100644 (file)
@@ -23,9 +23,10 @@ IMPLEMENT_STANDARD_RTTIEXT(Express_Field,Standard_Transient)
 //purpose  : 
 //=======================================================================
 
-Express_Field::Express_Field (const Standard_CString name,
-                               const Handle(Express_Type) &type,
-                               const Standard_Boolean opt)
+Express_Field::Express_Field(
+  const Standard_CString name,
+  const Handle(Express_Type) &type,
+  const Standard_Boolean opt)
 {
   myName = new TCollection_HAsciiString ( name );
   myType = type;
@@ -37,9 +38,10 @@ Express_Field::Express_Field (const Standard_CString name,
 //purpose  : 
 //=======================================================================
 
-Express_Field::Express_Field (const Handle(TCollection_HAsciiString) &name,
-                               const Handle(Express_Type) &type,
-                               const Standard_Boolean opt)
+Express_Field::Express_Field(
+  const Handle(TCollection_HAsciiString) &name,
+  const Handle(Express_Type) &type,
+  const Standard_Boolean opt)
 {
   myName = name;
   myType = type;
index 05a1ceafbdb61f01a5fcd67b56dac31ac1d1a971..46d0489630520358595a14a48dc489cddb78fcbb 100644 (file)
 class TCollection_HAsciiString;
 class Express_Type;
 
-
 //! Represents field of the ENTITY item in the EXPRESS schema
 class Express_Field : public Standard_Transient
 {
 
 public:
-
   
   //! Create object and initialize it
-  Standard_EXPORT Express_Field(const Standard_CString name, const Handle(Express_Type)& type, const Standard_Boolean opt);
+  Standard_EXPORT Express_Field(
+    const Standard_CString name,
+    const Handle(Express_Type)& type,
+    const Standard_Boolean opt);
   
   //! Create object and initialize it
-  Standard_EXPORT Express_Field(const Handle(TCollection_HAsciiString)& name, const Handle(Express_Type)& type, const Standard_Boolean opt);
+  Standard_EXPORT Express_Field(
+    const Handle(TCollection_HAsciiString)& name,
+    const Handle(Express_Type)& type,
+    const Standard_Boolean opt);
   
   //! Returns field name
   Standard_EXPORT  const  Handle(TCollection_HAsciiString)& Name()  const;
@@ -42,30 +46,16 @@ public:
   //! Returns True if field is optional
   Standard_EXPORT   Standard_Boolean IsOptional()  const;
 
-
-
-
   DEFINE_STANDARD_RTTIEXT(Express_Field,Standard_Transient)
 
 protected:
 
-
-
-
 private: 
 
-
   Handle(TCollection_HAsciiString) myName;
   Handle(Express_Type) myType;
   Standard_Boolean myOpt;
 
-
 };
 
-
-
-
-
-
-
 #endif // _Express_Field_HeaderFile
index 4d3ad2ffcdb490677af020c2e7e1b8a8e2130c35..649e818469f706326cbaef8eb045f78d19ff5e72 100644 (file)
@@ -19,5 +19,4 @@
 
 DEFINE_HSEQUENCE(Express_HSequenceOfEntity, Express_SequenceOfEntity)
 
-
 #endif
index 46ab070161e6be0d282e05ee44ab4fd7f9e8158b..4fde3dee92901e99b6afd6dd9aa366b6ee807ee8 100644 (file)
@@ -19,5 +19,4 @@
 
 DEFINE_HSEQUENCE(Express_HSequenceOfField, Express_SequenceOfField)
 
-
 #endif
index 64909915b5cc1cfc5a7fc9e18709910ac8b55bf3..a6ea4fa99a1e83aee1979951a1f9a6a8a886ae2d 100644 (file)
@@ -19,5 +19,4 @@
 
 DEFINE_HSEQUENCE(Express_HSequenceOfItem, Express_SequenceOfItem)
 
-
 #endif
index 0490b5e1ea77085d85581d08b505f3375255e54f..ed192202317b7316b4c993ba3739b34f411d435d 100644 (file)
 #include <Express_PredefinedType.hxx>
 class TCollection_HAsciiString;
 
-
 //! Implements EXPRESS type 'INTEGER'
 class Express_Integer : public Express_PredefinedType
 {
 
 public:
-
   
   //! Empty constructor
   Standard_EXPORT Express_Integer();
   
   //! Returns "Standard_Integer"
   Standard_EXPORT virtual   Handle(TCollection_HAsciiString) CPPName()  const Standard_OVERRIDE;
-  
-
-
 
   DEFINE_STANDARD_RTTIEXT(Express_Integer,Express_PredefinedType)
 
 protected:
 
-
-
-
 private: 
 
-
-
-
 };
 
-
-
-
-
-
-
 #endif // _Express_Integer_HeaderFile
index b2e9aed53fd4f44de1bee20be2d996c47c63ab70..79feabf3f0c9527ee7c0ea377112bd96c125b243 100644 (file)
@@ -67,7 +67,7 @@ const Handle(TCollection_HAsciiString) &Express_Item::Name () const
 
 Handle(TCollection_HAsciiString) Express_Item::CPPName () const
 {
-  Handle(TCollection_HAsciiString) name = GetPackageName ( Standard_True )->Cat ( "_" );
+  Handle(TCollection_HAsciiString) name = GetPackageName(Standard_True)->Cat("_");
   name->AssignCat ( myName );
   return name;
 }
@@ -89,7 +89,10 @@ void Express_Item::SetPackageName (const Handle(TCollection_HAsciiString) &pack)
 
 Handle(TCollection_HAsciiString) Express_Item::GetPackageName (const Standard_Boolean Auto) const
 {
-  if ( myPack.IsNull() && Auto ) return new TCollection_HAsciiString ( "StepStep" );
+  if (myPack.IsNull() && Auto)
+  {
+    return new TCollection_HAsciiString("StepStep");
+  }
   return myPack;
 }
 
@@ -120,9 +123,14 @@ void Express_Item::SetMark (const Standard_Boolean mark)
 
 Standard_Boolean Express_Item::Generate ()
 {
-  if ( ! GetMark() ) return Standard_False;
-  if ( GetPackageName().IsNull() )
-    SetPackageName ( GetPackageName ( Standard_True ) );
+  if (!GetMark())
+  {
+    return Standard_False;
+  }
+  if (GetPackageName().IsNull())
+  {
+    SetPackageName(GetPackageName(Standard_True));
+  }
   SetMark ( Standard_False );
   return GenerateClass();
 }
@@ -132,32 +140,42 @@ Standard_Boolean Express_Item::Generate ()
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Express_Item::Use (const Handle(TCollection_HAsciiString) &pack, 
-                                    const Standard_Boolean defer) 
+Standard_Boolean Express_Item::Use(
+  const Handle(TCollection_HAsciiString) &pack,
+  const Standard_Boolean defer)
 {
-  if ( ! GetPackageName().IsNull() ) {
+  if (!GetPackageName().IsNull())
+  {
     // issue a warning message if item from known package uses item from unknown package (StepStep)
-    if ( pack->String().IsDifferent ( "StepStep" ) &&
-         GetPackageName()->String().IsEqual ( "StepStep" ) ) {
-      std::cout << "Warning: item " << Name()->ToCString() << " has no package assigned, but used from package " << pack->ToCString() << std::endl;
+    if (pack->String().IsDifferent("StepStep") && GetPackageName()->String().IsEqual("StepStep"))
+    {
+      std::cout << "Warning: item " << Name()->ToCString() << " has no package assigned, but used from package "
+        << pack->ToCString() << std::endl;
     }
-  
     return Standard_False;
   }
   
   // issue a warning message if type still does not have package assigned
-  if ( pack->String().IsDifferent ( "StepStep" ) ) {
-    std::cout << "Warning: item " << Name()->ToCString() << " has no package assigned, setting " << pack->ToCString() << std::endl;
+  if (pack->String().IsDifferent("StepStep"))
+  {
+    std::cout << "Warning: item " << Name()->ToCString() << " has no package assigned, setting "
+      << pack->ToCString() << std::endl;
   }
   
   SetPackageName ( pack );
   SetMark ( Standard_True );
-  if ( defer ) return Standard_False;
+  if (defer)
+  {
+    return Standard_False;
+  }
   
   // manage indent for cout in order to mark structure of calls
   static Standard_Integer shift=0;
   shift++;
-  for ( Standard_Integer i=0; i < shift; i++ ) std::cout << "  ";
+  for (Standard_Integer i = 0; i < shift; i++)
+  {
+    std::cout << "  ";
+  }
   Standard_Boolean res = Generate(); 
   shift--;
   return res;
index 1248a9ccf539f09a5190dc29ac4906da8e2b2657..bba2a753aa80a3146c03f5c795a363815fb30f00 100644 (file)
@@ -22,7 +22,6 @@
 #include <Standard_CString.hxx>
 class TCollection_HAsciiString;
 
-
 //! Base class for items of the schema. Stores a name of the class,
 //! package name and flag used to mark items for generation.
 //! Provides interface for writing generated class definitions to HXX
@@ -42,7 +41,7 @@ public:
   //! Returns package name
   //! If not defined, returns NULL if auto is False (default)
   //! or "StepStep" if auto is True
-  Standard_EXPORT   Handle(TCollection_HAsciiString) GetPackageName (const Standard_Boolean Auto = Standard_False)  const;
+  Standard_EXPORT Handle(TCollection_HAsciiString) GetPackageName(const Standard_Boolean Auto = Standard_False) const;
   
   //! Sets package name
   Standard_EXPORT   void SetPackageName (const Handle(TCollection_HAsciiString)& pack) ;
@@ -66,7 +65,9 @@ public:
   //! by pack argument (supposing that it is package of item that uses
   //! current one) and Mark flag is set. Then, if defer is False,
   //! calls Generate().
-  Standard_EXPORT   Standard_Boolean Use (const Handle(TCollection_HAsciiString)& pack, const Standard_Boolean defer = Standard_False) ;
+  Standard_EXPORT   Standard_Boolean Use(
+    const Handle(TCollection_HAsciiString)& pack,
+    const Standard_Boolean defer = Standard_False);
   
   //! Set category for item
   Standard_EXPORT   void SetCategory (const Handle(TCollection_HAsciiString)& categ) ;
@@ -98,13 +99,9 @@ public:
   //! Get current entity index
   Standard_EXPORT static Standard_Integer Index();
 
-
-
-
   DEFINE_STANDARD_RTTIEXT(Express_Item,Standard_Transient)
 
 protected:
-
   
   //! Creates object and initialises fields PackageName and
   //! CreateFlag by 0
@@ -114,11 +111,8 @@ protected:
   //! CreateFlag by 0
   Standard_EXPORT Express_Item(const Handle(TCollection_HAsciiString)& name);
 
-
-
 private: 
 
-
   Handle(TCollection_HAsciiString) myName;
   Handle(TCollection_HAsciiString) myPack;
   Standard_Boolean myMark;
@@ -127,12 +121,6 @@ private:
   Standard_Boolean myhasCheck;
   Standard_Boolean myhasFillShared;
 
-
 };
 
-
-
-
-
-
 #endif // _Express_Item_HeaderFile
index 4b1e0a286d7c3115a11172d1324633db62ad4d3d..d948a3ead9440bbdcd6c142a69fd3feb462301f6 100644 (file)
@@ -34,7 +34,7 @@ Express_Logical::Express_Logical ()
 
 Handle(TCollection_HAsciiString) Express_Logical::CPPName () const
 {
-  return new TCollection_HAsciiString ( "StepData_Logical" );
+  return new TCollection_HAsciiString("StepData_Logical");
 }
 
 //=======================================================================
index 01fb3c5a7c80a2db2053b364c4c0cadd8876de99..8d9109cbb2517d808261bfb2f56e6c4096e65e28 100644 (file)
 #define _Express_Logical_HeaderFile
 
 #include <Standard_Type.hxx>
-
 #include <Express_PredefinedType.hxx>
 
 class TCollection_HAsciiString;
 
-
 //! Implements EXPRESS type 'LOGICAL'
 class Express_Logical : public Express_PredefinedType
 {
 
 public:
-
   
   //! Empty constructor
   Standard_EXPORT Express_Logical();
@@ -43,27 +40,12 @@ public:
   //! Return False
   Standard_EXPORT virtual   Standard_Boolean IsHandle()  const Standard_OVERRIDE;
 
-
-
-
   DEFINE_STANDARD_RTTIEXT(Express_Logical,Express_PredefinedType)
 
 protected:
 
-
-
-
 private: 
 
-
-
-
 };
 
-
-
-
-
-
-
 #endif // _Express_Logical_HeaderFile
index 7c6c34503350f42a97d557cddcbba586f3535389..452a1773e2f15c570118dac33c82981afc68730c 100644 (file)
@@ -88,8 +88,9 @@ Handle(TCollection_HAsciiString) Express_NamedType::CPPName () const
 
 Standard_Boolean Express_NamedType::IsStandard () const
 {
-  if ( myItem->IsKind(STANDARD_TYPE(Express_Alias)) ) {
-    Handle(Express_Alias) alias = Handle(Express_Alias)::DownCast ( myItem );
+  if (myItem->IsKind(STANDARD_TYPE(Express_Alias)))
+  {
+    Handle(Express_Alias) alias = Handle(Express_Alias)::DownCast(myItem);
     return alias->Type()->IsStandard();
   }
   return Standard_False;
@@ -102,11 +103,15 @@ Standard_Boolean Express_NamedType::IsStandard () const
 
 Standard_Boolean Express_NamedType::IsSimple () const
 {
-  if ( myItem->IsKind(STANDARD_TYPE(Express_Alias)) ) {
-    Handle(Express_Alias) alias = Handle(Express_Alias)::DownCast ( myItem );
+  if (myItem->IsKind(STANDARD_TYPE(Express_Alias)))
+  {
+    Handle(Express_Alias) alias = Handle(Express_Alias)::DownCast(myItem);
     return alias->Type()->IsSimple();
   }
-  if ( myItem->IsKind(STANDARD_TYPE(Express_Enum)) ) return Standard_True;
+  if (myItem->IsKind(STANDARD_TYPE(Express_Enum)))
+  {
+    return Standard_True;
+  }
   return Standard_False; // SELECT & ENTITY
 }
 
@@ -117,11 +122,15 @@ Standard_Boolean Express_NamedType::IsSimple () const
 
 Standard_Boolean Express_NamedType::IsHandle () const
 {
-  if ( myItem->IsKind(STANDARD_TYPE(Express_Alias)) ) {
+  if (myItem->IsKind(STANDARD_TYPE(Express_Alias)))
+  {
     Handle(Express_Alias) alias = Handle(Express_Alias)::DownCast ( myItem );
     return alias->Type()->IsHandle();
   }
-  if ( myItem->IsKind(STANDARD_TYPE(Express_Entity)) ) return Standard_True;
+  if (myItem->IsKind(STANDARD_TYPE(Express_Entity)))
+  {
+    return Standard_True;
+  }
   return Standard_False; // SELECT & ENUMERATION
 }
 
@@ -130,8 +139,9 @@ Standard_Boolean Express_NamedType::IsHandle () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Express_NamedType::Use (const Handle(TCollection_HAsciiString) &pack,
-                                         const Standard_Boolean defer) const
+Standard_Boolean Express_NamedType::Use(
+  const Handle(TCollection_HAsciiString) &pack,
+  const Standard_Boolean defer) const
 {
   return myItem->Use ( pack, defer );
 }
index e43daf05416e937a258e1cf55b662db9bd9b8cce..884b4883a476c33764b3784c73584676b733bbb3 100644 (file)
 #define _Express_NamedType_HeaderFile
 
 #include <Standard_Type.hxx>
-
 #include <Express_Type.hxx>
 
 class TCollection_HAsciiString;
 class Express_Item;
 
-
 //! Base class for complex types (ARRAY, LIST, BAG, SET)
 //! in EXPRESS schema
 //! Stores type of elements and
@@ -29,7 +27,6 @@ class Express_NamedType : public Express_Type
 {
 
 public:
-
   
   //! Creates an object and initializes by name
   Standard_EXPORT Express_NamedType(const Standard_CString name);
@@ -60,31 +57,19 @@ public:
   
   //! Declares type as used by some item being generated.
   //! Calls Use() for referred item (found by name).
-  Standard_EXPORT virtual   Standard_Boolean Use(const Handle(TCollection_HAsciiString)& pack, const Standard_Boolean defer = Standard_False)  const Standard_OVERRIDE;
-
-
-
+  Standard_EXPORT virtual   Standard_Boolean Use(
+    const Handle(TCollection_HAsciiString)& pack,
+    const Standard_Boolean defer = Standard_False)  const Standard_OVERRIDE;
 
   DEFINE_STANDARD_RTTIEXT(Express_NamedType,Express_Type)
 
 protected:
 
-
-
-
 private: 
 
-
   Handle(TCollection_HAsciiString) myName;
   Handle(Express_Item) myItem;
 
-
 };
 
-
-
-
-
-
-
 #endif // _Express_NamedType_HeaderFile
index 7f59a926edc8d61763adea31b395ed7d7575688b..d32455b34fc1c17b8d72764d2bf11a5487438548 100644 (file)
@@ -15,7 +15,6 @@
 #define _Express_PredefinedType_HeaderFile
 
 #include <Standard_Type.hxx>
-
 #include <Express_Type.hxx>
 
 //! Base class for predefined types (like NUMBER or STRING)
@@ -24,35 +23,19 @@ class Express_PredefinedType : public Express_Type
 {
 
 public:
-
   
   //! Returns True
   Standard_EXPORT virtual   Standard_Boolean IsStandard()  const Standard_OVERRIDE;
 
-
-
-
   DEFINE_STANDARD_RTTIEXT(Express_PredefinedType,Express_Type)
 
 protected:
-
   
   //! Empty constructor
   Standard_EXPORT Express_PredefinedType();
 
-
-
 private: 
 
-
-
-
 };
 
-
-
-
-
-
-
 #endif // _Express_PredefinedType_HeaderFile
index 7ee5c21d7089f71d850400bc46a468624b003aeb..878f78569eeb47a8e90d565b19c43997af433fb4 100644 (file)
@@ -34,5 +34,5 @@ Express_Real::Express_Real ()
 
 Handle(TCollection_HAsciiString) Express_Real::CPPName () const
 {
-  return new TCollection_HAsciiString ( "Standard_Real" );
+  return new TCollection_HAsciiString("Standard_Real");
 }
index 1d8deae96d777df969a00d07c99aaca9359a361f..8f9d8acef5c124d889377ce62f01429092ed29eb 100644 (file)
 #define _Express_Real_HeaderFile
 
 #include <Standard_Type.hxx>
-
 #include <Express_PredefinedType.hxx>
 class TCollection_HAsciiString;
 
-
 //! Implements EXPRESS type 'REAL'
 class Express_Real : public Express_PredefinedType
 {
 
 public:
-
   
   //! Empty constructor
   Standard_EXPORT Express_Real();
   
   //! Returns "Standard_Real"
   Standard_EXPORT virtual   Handle(TCollection_HAsciiString) CPPName()  const Standard_OVERRIDE;
-  
-
-
 
   DEFINE_STANDARD_RTTIEXT(Express_Real,Express_PredefinedType)
 
 protected:
 
-
-
-
 private: 
 
-
-
-
 };
 
-
-
-
-
-
-
 #endif // _Express_Real_HeaderFile
index 5671b21bf9ee3d49c3771fbc9ee2f7f0c3ee5635..02b33f3eb36ab736057056256d465b94f43068c3 100644 (file)
@@ -22,9 +22,10 @@ IMPLEMENT_STANDARD_RTTIEXT(Express_Reference,Express_Item)
 //purpose  : 
 //=======================================================================
 
-Express_Reference::Express_Reference (const Standard_CString name,
-                                        const Handle(TColStd_HSequenceOfHAsciiString) &types)
-     : Express_Item ( name )
+Express_Reference::Express_Reference(
+  const Standard_CString name,
+  const Handle(TColStd_HSequenceOfHAsciiString) &types)
+  : Express_Item(name)
 {
   myTypes = types;
 }
index a0856e3062b2d403efa69e3b4dc33254da4077bf..d03e6ecc6ac6aca6911bc923b49484adc2b68f40 100644 (file)
 
 class Express_HSequenceOfItem;
 
-
 //! Implements REFERENCE FROM (list of types used from other schema)
 //! item of the EXPRESS schema, with interface for Item class.
 class Express_Reference : public Express_Item
 {
 
 public:
-
   
   //! Create Reference item and initialize it
   Standard_EXPORT Express_Reference(const Standard_CString name, const Handle(TColStd_HSequenceOfHAsciiString)& types);
   
   //! Returns list of types referenced
-  const  Handle(TColStd_HSequenceOfHAsciiString)& Types() const { return myTypes; }
+  const  Handle(TColStd_HSequenceOfHAsciiString)& Types() const
+  {
+    return myTypes;
+  }
 
   //! Returns handle to sequence of items corresponding to
   //! listed types
-  const  Handle(Express_HSequenceOfItem)& Items() const { return myItems; }
+  const  Handle(Express_HSequenceOfItem)& Items() const
+  {
+    return myItems;
+  }
   
   //! Redefined to empty (in order to be able to instantiate)
   //! Returna False
   Standard_EXPORT virtual   Standard_Boolean GenerateClass()  const Standard_OVERRIDE;
 
-
-
-
   DEFINE_STANDARD_RTTIEXT(Express_Reference,Express_Item)
 
 protected:
 
-
-
-
 private: 
 
-
   Handle(TColStd_HSequenceOfHAsciiString) myTypes;
   Handle(Express_HSequenceOfItem) myItems;
 
-
 };
 
-
 #endif // _Express_Reference_HeaderFile
index 8a1e6a7f4ae9c5f3fd206bba2a994aa4b4ea43c8..9ee5314c2fab72e6160222043552e771819090f9 100644 (file)
@@ -35,8 +35,9 @@ IMPLEMENT_STANDARD_RTTIEXT(Express_Schema,Standard_Transient)
 //purpose  : 
 //=======================================================================
 
-Express_Schema::Express_Schema (const Standard_CString name,
-                                 const Handle(Express_HSequenceOfItem) &items)
+Express_Schema::Express_Schema(
+  const Standard_CString name,
+  const Handle(Express_HSequenceOfItem) &items)
 {
   myName = new TCollection_HAsciiString ( name );
   myItems = items;
@@ -48,8 +49,9 @@ Express_Schema::Express_Schema (const Standard_CString name,
 //purpose  : 
 //=======================================================================
 
-Express_Schema::Express_Schema (const Handle(TCollection_HAsciiString) &name,
-                                 const Handle(Express_HSequenceOfItem) &items)
+Express_Schema::Express_Schema(
+  const Handle(TCollection_HAsciiString) &name,
+  const Handle(Express_HSequenceOfItem) &items)
 {
   myName = name;
   myItems = items;
@@ -91,7 +93,7 @@ Standard_Integer Express_Schema::NbItems () const
 //purpose  : 
 //=======================================================================
 
-Handle(Express_Item) Express_Schema::Item (const Standard_Integer num) const
+Handle(Express_Item) Express_Schema::Item(const Standard_Integer num) const
 {
   return myItems->Value(num);
 }
@@ -101,12 +103,16 @@ Handle(Express_Item) Express_Schema::Item (const Standard_Integer num) const
 //purpose  : 
 //=======================================================================
 
-Handle(Express_Item) Express_Schema::Item (const Standard_CString name, 
-                                            const Standard_Boolean silent) const
+Handle(Express_Item) Express_Schema::Item(
+  const Standard_CString name,
+  const Standard_Boolean silent) const
 {
-  if ( ! myDict.IsBound ( name ) ) {
-    if ( ! silent )
+  if (!myDict.IsBound(name))
+  {
+    if (!silent)
+    {
       std::cout << "Error: attempt to access unknown item by name " << name << std::endl;
+    }
     return 0;
   }
   return myDict.Find (name);
@@ -117,9 +123,9 @@ Handle(Express_Item) Express_Schema::Item (const Standard_CString name,
 //purpose  : 
 //=======================================================================
 
-Handle(Express_Item) Express_Schema::Item (const TCollection_AsciiString &name) const
+Handle(Express_Item) Express_Schema::Item(const TCollection_AsciiString &name) const
 {
-  return Item ( name.ToCString() );
+  return Item(name.ToCString());
 }
 
 //=======================================================================
@@ -127,138 +133,184 @@ Handle(Express_Item) Express_Schema::Item (const TCollection_AsciiString &name)
 //purpose  : 
 //=======================================================================
 
-Handle(Express_Item) Express_Schema::Item (const Handle(TCollection_HAsciiString) &name) const
+Handle(Express_Item) Express_Schema::Item(const Handle(TCollection_HAsciiString) &name) const
 {
-  return Item ( name->ToCString() );
+  return Item(name->ToCString());
 }
 
 //=======================================================================
-//function : Prepare
-//purpose  : 
+//function : nameToCasCade
+//purpose  : auxilary for Prepare()
+//           Convert STEP-style name (lowercase, with underscores)
+//           to CASCADE-style name (each word starts with uppercase, no intervals)
 //=======================================================================
-
-// Convert STEP-style name (lowercase, with underscores)
-// to CASCADE-style name (each word starts with uppercase, no intervals)
-static void NameToCasCade (const Handle(TCollection_HAsciiString) &name)
+static void nameToCasCade (const Handle(TCollection_HAsciiString) &name)
 {
-  if ( name.IsNull() ) return;
-  for ( Standard_Integer i=1; i <= name->Length(); i++ ) {
-    if ( name->Value(i) == '_' ) {
+  if (name.IsNull())
+  {
+    return;
+  }
+  for (Standard_Integer i = 1; i <= name->Length(); i++)
+  {
+    if ( name->Value(i) == '_' )
+    {
       name->Remove ( i );
     }
-    else if ( i >1 ) continue;
+    else if (i > 1)
+    {
+      continue;
+    }
     name->SetValue ( i, UpperCase ( name->Value(i) ) );
   }
 }
 
-// Convert names for Type object
-static void NameToCasCade (const Handle(Express_Type) &type)
+//=======================================================================
+//function : nameToCasCade
+//purpose  : auxilary for Prepare()
+//           Convert names for Type object
+//=======================================================================
+static void nameToCasCade (const Handle(Express_Type) &type)
 {
-  if ( type->IsKind(STANDARD_TYPE(Express_NamedType)) ) {
-    const Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast ( type );
-    NameToCasCade ( named->Name() );
+  if (type->IsKind(STANDARD_TYPE(Express_NamedType)))
+  {
+    const Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast(type);
+    nameToCasCade(named->Name());
   }
-  else if ( type->IsKind(STANDARD_TYPE(Express_ComplexType)) ) {
-    const Handle(Express_ComplexType) complex = Handle(Express_ComplexType)::DownCast ( type );
-    NameToCasCade ( complex->Type() );
+  else if (type->IsKind(STANDARD_TYPE(Express_ComplexType)))
+  {
+    const Handle(Express_ComplexType) complex = Handle(Express_ComplexType)::DownCast(type);
+    nameToCasCade(complex->Type());
   }
 }
 
-// Prepare data: convert names to CasCade, fill dictionary of typenames
-// and set handles to items where they are referenced by names
+//=======================================================================
+//function : Prepare
+//purpose  : Prepare data: convert names to CasCade, fill dictionary of typenames
+//           and set handles to items where they are referenced by names
+//=======================================================================
+
 void Express_Schema::Prepare ()
 {
   myDict.Clear();
-  if ( myItems.IsNull() ) return;
+  if (myItems.IsNull())
+  {
+    return;
+  }
   
   Standard_Integer nbItems = NbItems();
   
   // convert names annd fill dictionary
-  for ( Standard_Integer num=1; num <= nbItems; num++ ) {
+  for ( Standard_Integer num=1; num <= nbItems; num++ )
+  {
     // get item
     const Handle(Express_Item) item = Item(num);
 
     // change item name
-    NameToCasCade ( item->Name() );
+    nameToCasCade ( item->Name() );
 
     // change names of referred types and other names
-    if ( item->IsKind(STANDARD_TYPE(Express_Alias)) ) {
-      const Handle(Express_Alias) alias = Handle(Express_Alias)::DownCast ( item );
-      NameToCasCade ( alias->Type() );
+    if (item->IsKind(STANDARD_TYPE(Express_Alias)))
+    {
+      const Handle(Express_Alias) alias = Handle(Express_Alias)::DownCast(item);
+      nameToCasCade(alias->Type());
     }
-    else if ( item->IsKind(STANDARD_TYPE(Express_Select)) ) {
-      const Handle(Express_Select) select = Handle(Express_Select)::DownCast ( item );
-      for ( Standard_Integer i=1; i <= select->Names()->Length(); i++ )
-       NameToCasCade ( select->Names()->Value(i) );
+    else if (item->IsKind(STANDARD_TYPE(Express_Select)))
+    {
+      const Handle(Express_Select) select = Handle(Express_Select)::DownCast(item);
+      for (Standard_Integer i = 1; i <= select->Names()->Length(); i++)
+      {
+        nameToCasCade(select->Names()->Value(i));
+      }
     }
-    else if ( item->IsKind(STANDARD_TYPE(Express_Enum)) ) {
-      const Handle(Express_Enum) en = Handle(Express_Enum)::DownCast ( item );
-      for ( Standard_Integer i=1; i <= en->Names()->Length(); i++ )
-       NameToCasCade ( en->Names()->Value(i) );
+    else if (item->IsKind(STANDARD_TYPE(Express_Enum)))
+    {
+      const Handle(Express_Enum) en = Handle(Express_Enum)::DownCast(item);
+      for (Standard_Integer i = 1; i <= en->Names()->Length(); i++)
+      {
+        nameToCasCade(en->Names()->Value(i));
+      }
     }
-    else if ( item->IsKind(STANDARD_TYPE(Express_Entity)) ) {
-      const Handle(Express_Entity) ent = Handle(Express_Entity)::DownCast ( item );
-      for ( Standard_Integer i=1; i <= ent->SuperTypes()->Length(); i++ )
-       NameToCasCade ( ent->SuperTypes()->Value(i) );
+    else if (item->IsKind(STANDARD_TYPE(Express_Entity)))
+    {
+      const Handle(Express_Entity) ent = Handle(Express_Entity)::DownCast(item);
+      for (Standard_Integer i = 1; i <= ent->SuperTypes()->Length(); i++)
+      {
+        nameToCasCade(ent->SuperTypes()->Value(i));
+      }
       const Handle(Express_HSequenceOfField) fields = ent->Fields();
-      for (Standard_Integer i=1; i <= fields->Length(); i++ ) {
-       NameToCasCade ( fields->Value(i)->Name() );
-       NameToCasCade ( fields->Value(i)->Type() );
+      for (Standard_Integer i = 1; i <= fields->Length(); i++)
+      {
+        nameToCasCade(fields->Value(i)->Name());
+        nameToCasCade(fields->Value(i)->Type());
       }
     }
 
     // add to dictionary
-    myDict.Bind (item->Name()->String(), item);
+    myDict.Bind(item->Name()->String(), item);
   }
 
   // set references to items from other items and types
-  for (Standard_Integer num=1; num <= nbItems; num++ ) {
+  for (Standard_Integer num=1; num <= nbItems; num++ )
+  {
     const Handle(Express_Item) item = Item(num);
 
-    if ( item->IsKind(STANDARD_TYPE(Express_Alias)) ) {
+    if ( item->IsKind(STANDARD_TYPE(Express_Alias)) )
+    {
       const Handle(Express_Alias) alias = Handle(Express_Alias)::DownCast ( item );
       PrepareType ( alias->Type() );
       // for aliases, define package to avoid warnings
       alias->SetPackageName ( new TCollection_HAsciiString ( "Standard" ) );
       continue;
     }
-    else if ( item->IsKind(STANDARD_TYPE(Express_Select)) ) {
-      const Handle(Express_Select) select = Handle(Express_Select)::DownCast ( item );
+    else if (item->IsKind(STANDARD_TYPE(Express_Select)))
+    {
+      const Handle(Express_Select) select = Handle(Express_Select)::DownCast(item);
       Handle(TColStd_HSequenceOfHAsciiString) names = select->Names();
       Handle(Express_HSequenceOfItem) items = select->Items();
-      for ( Standard_Integer i=1; i <= names->Length(); i++ ) {
-       Handle(Express_Item) it = Item ( names->Value(i) );
-       // if select refers to another select, expand it
-       if ( it->IsKind(STANDARD_TYPE(Express_Select)) ) {
-         std::cout << "Info: SELECT " << item->Name()->ToCString() << " refers to another SELECT " << 
-                      it->Name()->ToCString() << "; expanded" << std::endl;
-         const Handle(Express_Select) sel = Handle(Express_Select)::DownCast ( it );
+      for (Standard_Integer i = 1; i <= names->Length(); i++)
+      {
+        Handle(Express_Item) it = Item(names->Value(i));
+        // if select refers to another select, expand it
+        if (it->IsKind(STANDARD_TYPE(Express_Select)))
+        {
+          std::cout << "Info: SELECT " << item->Name()->ToCString() << " refers to another SELECT " <<
+            it->Name()->ToCString() << "; expanded" << std::endl;
+          const Handle(Express_Select) sel = Handle(Express_Select)::DownCast(it);
           Standard_Integer j = 1;
-         for ( ; j <= sel->Names()->Length(); j++ )
-           names->InsertBefore ( i+j-1, sel->Names()->Value(j) );
-         names->Remove ( i+j-1 );
-         i--;
-         continue;
-       }
-       items->Append ( it );
+          for (; j <= sel->Names()->Length(); j++)
+          {
+            names->InsertBefore(i + j - 1, sel->Names()->Value(j));
+          }
+          names->Remove(i + j - 1);
+          i--;
+          continue;
+        }
+        items->Append(it);
       }
     }
-    else if ( item->IsKind(STANDARD_TYPE(Express_Entity)) ) {
-      const Handle(Express_Entity) ent = Handle(Express_Entity)::DownCast ( item );
+    else if ( item->IsKind(STANDARD_TYPE(Express_Entity)) )
+    {
+      const Handle(Express_Entity) ent = Handle(Express_Entity)::DownCast(item);
       Handle(TColStd_HSequenceOfHAsciiString) names = ent->SuperTypes();
       Handle(Express_HSequenceOfEntity) inh = ent->Inherit();
-      for ( Standard_Integer i=1; i <= names->Length(); i++ ) {
-       Handle(Express_Entity) subent = Handle(Express_Entity)::DownCast ( Item ( names->Value(i) ) );
-       if ( ! subent.IsNull() ) inh->Append ( subent );
-       else 
+      for (Standard_Integer i = 1; i <= names->Length(); i++)
+      {
+        Handle(Express_Entity) subent = Handle(Express_Entity)::DownCast(Item(names->Value(i)));
+        if (!subent.IsNull())
         {
-          std::cout << "Error in " << item->Name()->ToCString() << ": supertype " << 
-                       names->Value(i)->ToCString() << " is not an ENTITY; ignored" << std::endl;
+          inh->Append(subent);
+        }
+        else
+        {
+          std::cout << "Error in " << item->Name()->ToCString() << ": supertype " <<
+            names->Value(i)->ToCString() << " is not an ENTITY; ignored" << std::endl;
         }
       }
       const Handle(Express_HSequenceOfField) fields = ent->Fields();
-      for (Standard_Integer i=1; i <= fields->Length(); i++ )
-       PrepareType ( fields->Value(i)->Type() );
+      for (Standard_Integer i = 1; i <= fields->Length(); i++)
+      {
+        PrepareType(fields->Value(i)->Type());
+      }
     }
   }
 
@@ -269,14 +321,16 @@ void Express_Schema::Prepare ()
 //purpose  : 
 //=======================================================================
 
-void Express_Schema::PrepareType (const Handle(Express_Type) &type) const
+void Express_Schema::PrepareType(const Handle(Express_Type) &type) const
 {
-  if ( type->IsKind(STANDARD_TYPE(Express_NamedType)) ) {
-    Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast ( type );
-    named->SetItem ( Item ( named->Name() ) );
+  if (type->IsKind(STANDARD_TYPE(Express_NamedType)))
+  {
+    Handle(Express_NamedType) named = Handle(Express_NamedType)::DownCast(type);
+    named->SetItem(Item(named->Name()));
   }
-  else if ( type->IsKind(STANDARD_TYPE(Express_ComplexType)) ) {
-    Handle(Express_ComplexType) complex = Handle(Express_ComplexType)::DownCast ( type );
-    PrepareType ( complex->Type() );
+  else if (type->IsKind(STANDARD_TYPE(Express_ComplexType)))
+  {
+    Handle(Express_ComplexType) complex = Handle(Express_ComplexType)::DownCast(type);
+    PrepareType(complex->Type());
   }
 }
index 94551f26246a9d901eb16159ac6de819a3eeed4c..08ef991bc192ceac48b51cc9c7ed9b15f0fc6fd0 100644 (file)
@@ -24,7 +24,6 @@ class Express_Item;
 class TCollection_AsciiString;
 class Express_Type;
 
-
 //! Represents a schema as a list of items and provides general
 //! tools for generating HXX/CXX files (including dictionary of
 //! item names)
@@ -32,7 +31,6 @@ class Express_Schema : public Standard_Transient
 {
 
 public:
-
   
   //! Creates a schema with given name and given set of items
   //! and calls Prepare()
@@ -40,7 +38,9 @@ public:
   
   //! Creates a schema with given name and given set of items
   //! and calls Prepare()
-  Standard_EXPORT Express_Schema(const Handle(TCollection_HAsciiString)& Name, const Handle(Express_HSequenceOfItem)& items);
+  Standard_EXPORT Express_Schema(
+    const Handle(TCollection_HAsciiString)& Name,
+    const Handle(Express_HSequenceOfItem)& items);
   
   //! Returns schema name
   Standard_EXPORT  const  Handle(TCollection_HAsciiString)& Name()  const;
@@ -55,7 +55,9 @@ public:
   Standard_EXPORT   Handle(Express_Item) Item (const Standard_Integer num)  const;
   
   //! Returns item by name
-  Standard_EXPORT   Handle(Express_Item) Item (const Standard_CString name, const Standard_Boolean silent = Standard_False)  const;
+  Standard_EXPORT   Handle(Express_Item) Item(
+    const Standard_CString name,
+    const Standard_Boolean silent = Standard_False)  const;
   
   //! Returns item by name
   Standard_EXPORT   Handle(Express_Item) Item (const TCollection_AsciiString& name)  const;
@@ -63,18 +65,11 @@ public:
   //! Returns item by name
   Standard_EXPORT   Handle(Express_Item) Item (const Handle(TCollection_HAsciiString)& name)  const;
 
-
-
-
   DEFINE_STANDARD_RTTIEXT(Express_Schema,Standard_Transient)
 
 protected:
 
-
-
-
 private: 
-
   
   //! Prepares data for further work. Converts all item names
   //! from EXPRESS style (aaa_bb) to CASCADE style (AaaBb).
@@ -90,6 +85,7 @@ private:
   Handle(TCollection_HAsciiString) myName;
   Handle(Express_HSequenceOfItem) myItems;
   Express_DataMapOfAsciiStringItem myDict;
+
 };
 
 #endif // _Express_Schema_HeaderFile
index 2d8cdd4d317936e72d5c6b5e6ca6750f029b42a9..ddee6e9f12917ef5465736beb6f5d7d024d76c94 100644 (file)
@@ -37,9 +37,10 @@ IMPLEMENT_STANDARD_RTTIEXT(Express_Select,Express_Item)
 //purpose  : 
 //=======================================================================
 
-Express_Select::Express_Select (const Standard_CString name, 
-                                 const Handle(TColStd_HSequenceOfHAsciiString) &names)
-     : Express_Item(name), myNames(names)
+Express_Select::Express_Select(
+  const Standard_CString name,
+  const Handle(TColStd_HSequenceOfHAsciiString) &names)
+  : Express_Item(name), myNames(names)
 {
   myItems = new Express_HSequenceOfItem;
 }
@@ -75,28 +76,34 @@ Standard_Boolean Express_Select::GenerateClass () const
   
   Handle(TColStd_HSequenceOfInteger) seqMember = new TColStd_HSequenceOfInteger;
   Handle(TColStd_HSequenceOfInteger) seqEntities = new TColStd_HSequenceOfInteger;
-  for ( Standard_Integer i=1; i <= myItems->Length(); i++ ) {
+  for (Standard_Integer i = 1; i <= myItems->Length(); i++)
+  {
     Handle(Express_Item) item = myItems->Value(i);
     if (item->IsKind(STANDARD_TYPE(Express_Entity)) || item->IsKind(STANDARD_TYPE(Express_Select))
       || item->IsKind(STANDARD_TYPE(Express_Alias)) || item->IsKind(STANDARD_TYPE(Express_ComplexType)))
-       seqEntities->Append(i);
-    else seqMember->Append(i);
-    
+    {
+      seqEntities->Append(i);
+    }
+    else
+    {
+      seqMember->Append(i);
+    }
   }
   std::cout << "Generating SELECT " << CPPname->ToCString() << std::endl;
-  if(!seqMember->IsEmpty()) {
-    std::cout << "Generating SELECTMember " << CPPname->ToCString() << "Member"<< std::endl;
+  if (!seqMember->IsEmpty())
+  {
+    std::cout << "Generating SELECTMember " << CPPname->ToCString() << "Member" << std::endl;
     GenerateSelectMember(seqMember);
   }
   // create a package directory (if not yet exist)
-  OSD_Protection prot ( OSD_RX, OSD_RWX, OSD_RX, OSD_RX );
+  OSD_Protection prot(OSD_RX, OSD_RWX, OSD_RX, OSD_RX);
   TCollection_AsciiString pack = GetPackageName()->String();
-  OSD_Path path ( pack );
-  OSD_Directory dir ( path );
-  dir.Build ( prot );
+  OSD_Path path(pack);
+  OSD_Directory dir(path);
+  dir.Build(prot);
   pack += "/";
   pack += CPPname->String();
-  
+
   //===============================
   // Step 1: generating HXX
   
@@ -124,14 +131,18 @@ Standard_Boolean Express_Select::GenerateClass () const
     os << "class StepData_SelectMember;" << std::endl;
 
   Standard_Integer jj = 1;
-  for (Standard_Integer i = 1; i <= myItems->Length(); i++) {
+  for (Standard_Integer i = 1; i <= myItems->Length(); i++)
+  {
     Handle(Express_Item) item = myItems->Value(i);
     item->Use(GetPackageName());
-    if (item->IsKind(STANDARD_TYPE(Express_Alias))) {
+    if (item->IsKind(STANDARD_TYPE(Express_Alias)))
+    {
       Handle(Express_Type) type = Handle(Express_Alias)::DownCast(item)->Type();
       TCollection_AsciiString ats = type->CPPName()->String();
       if (type->IsStandard()) //(STANDARD_TYPE(Express_PredefinedType)))
+      {
         continue;
+      }
     }
     os << "class " << item->CPPName()->ToCString() << ";" << std::endl;
     jj++;
@@ -155,16 +166,19 @@ Standard_Boolean Express_Select::GenerateClass () const
   
   // write common methods section
   os << "  //! Recognizes a kind of " << Name()->ToCString() << " select type" << std::endl;
-  for (Standard_Integer i = 1; i <= seqEntities->Length(); i++) {
+  for (Standard_Integer i = 1; i <= seqEntities->Length(); i++)
+  {
     Standard_Integer ind = seqEntities->Value(i);
     os << "  //! -- " << i << " -> " << myNames->Value(ind)->ToCString() << std::endl;
   }
   os << "  Standard_EXPORT Standard_Integer CaseNum (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;" << std::endl;
   os << std::endl;
 
-  if(!seqMember->IsEmpty()) {
+  if(!seqMember->IsEmpty())
+  {
     os << "  //! Recognizes items of select member " << Name()->ToCString() << "Member" << std::endl;
-    for (Standard_Integer i = 1; i <= seqMember->Length(); i++) {
+    for (Standard_Integer i = 1; i <= seqMember->Length(); i++)
+    {
       Standard_Integer ind = seqMember->Value(i);
       os << "  //! -- " << i << " -> " << myNames->Value(ind)->ToCString() << std::endl;
     }
@@ -178,17 +192,20 @@ Standard_Boolean Express_Select::GenerateClass () const
   }
 
   // write methods get for entities
-  for (Standard_Integer i = 1; i <= seqEntities->Length(); i++) {
+  for (Standard_Integer i = 1; i <= seqEntities->Length(); i++)
+  {
     Standard_Integer ind = seqEntities->Value(i);
     Handle(Express_Item) item = myItems->Value(ind);
     Handle(TCollection_HAsciiString) name = item->Name();
     os << "  //! Returns Value as " << name->ToCString() << " (or Null if another type)" << std::endl;
-    os << "  Standard_EXPORT Handle(" << item->CPPName()->ToCString() << ") "  << name->ToCString() << "() const;" << std::endl;
+    os << "  Standard_EXPORT Handle(" << item->CPPName()->ToCString() << ") "  <<
+      name->ToCString() << "() const;" << std::endl;
     os << std::endl;
   }
 
   // writes method set and get for enum , integer, real and string.
-  for (Standard_Integer i = 1; i <= seqMember->Length(); i++) {
+  for (Standard_Integer i = 1; i <= seqMember->Length(); i++)
+  {
     Standard_Integer ind = seqMember->Value(i);
     Handle(Express_Item) item = myItems->Value(ind);
     Handle(TCollection_HAsciiString) name = item->Name();
@@ -217,14 +234,15 @@ Standard_Boolean Express_Select::GenerateClass () const
 
   // write include section
   os << "#include <" << CPPname->ToCString() << ".hxx>" << std::endl;
-  if(!seqMember->IsEmpty()) {
+  if(!seqMember->IsEmpty())
+  {
     os << "#include <" << CPPName()->ToCString() << "Member.hxx>"<< std::endl;
     os << "#include <TCollection_HAsciiString.hxx>"<< std::endl;
   }
-  for (Standard_Integer i = 1; i <= seqEntities->Length(); i++)  {
+  for (Standard_Integer i = 1; i <= seqEntities->Length(); i++)
+  {
     Standard_Integer ind = seqEntities->Value(i);
-    os << "#include <" <<
-      myItems->Value(ind)->CPPName()->ToCString() << ".hxx>" << std::endl;
+    os << "#include <" << myItems->Value(ind)->CPPName()->ToCString() << ".hxx>" << std::endl;
   }
 
   // write constructor
@@ -233,153 +251,193 @@ Standard_Boolean Express_Select::GenerateClass () const
   os << "{" << std::endl << "}" << std::endl;
 
   // write CaseNum method
-  Express::WriteMethodStamp ( os, new TCollection_HAsciiString ( "CaseNum" ) );
-  os << "Standard_Integer " << CPPname->ToCString() << "::CaseNum (const Handle(Standard_Transient)& ent) const" << std::endl;
+  Express::WriteMethodStamp(os, new TCollection_HAsciiString("CaseNum"));
+  os << "Standard_Integer " << CPPname->ToCString() <<
+    "::CaseNum (const Handle(Standard_Transient)& ent) const" << std::endl;
   os << "{" << std::endl;
   
-  if(!seqEntities->IsEmpty()) {
+  if(!seqEntities->IsEmpty())
+  {
     os << "  if (ent.IsNull()) return 0;" << std::endl;
-    for (Standard_Integer i=1; i <= seqEntities->Length(); i++ )  {
+    for (Standard_Integer i = 1; i <= seqEntities->Length(); i++)
+    {
       Standard_Integer ind = seqEntities->Value(i);
-      os << "  if (ent->IsKind(STANDARD_TYPE(" << 
+      os << "  if (ent->IsKind(STANDARD_TYPE(" <<
         myItems->Value(ind)->CPPName()->ToCString() << "))) return " << i << ";" << std::endl;
     }
     os << "  return 0;\n}" << std::endl;
   }
-  else os << "  return 0;\n}" << std::endl;
+  else
+  {
+    os << "  return 0;\n}" << std::endl;
+  }
 
-  if(!seqMember->IsEmpty()) { //gka for AP209
+  if (!seqMember->IsEmpty())
+  { //gka for AP209
     //write CaseMem method
-    Express::WriteMethodStamp ( os, new TCollection_HAsciiString ( "CaseMem" ) );
-    os<<"Standard_Integer "<<CPPname->ToCString()<<"::CaseMem (const Handle(StepData_SelectMember)& ent) const"<< std::endl;
-    os<<"{"<< std::endl;
-    os<<" if(ent.IsNull()) return 0;"<< std::endl;
+    Express::WriteMethodStamp(os, new TCollection_HAsciiString("CaseMem"));
+    os << "Standard_Integer " << CPPname->ToCString() <<
+      "::CaseMem (const Handle(StepData_SelectMember)& ent) const" << std::endl;
+    os << "{" << std::endl;
+    os << " if(ent.IsNull()) return 0;" << std::endl;
     //os<<" Handle("<< CPPName()->ToCString()<<"Member sm = Handle("<<CPPName()->ToCString()<<"Member)::DownCast(ent);"<< std::endl; 
     //os<<" if(sm.IsNull()) return 0;"<< std::endl;
     //os<<" Handle(TCollection_HAsciiString) name;"<< std::endl;
-    for( int j = 1; j<= seqMember->Length(); j++) {
+    for (int j = 1; j <= seqMember->Length(); j++)
+    {
       Standard_Integer ind = seqMember->Value(j);
       //os<<"  name = new TCollection_HAsciiString(\""<<myNames->Value(ind)->ToCString()<<"\");"<< std::endl;
-      if(j ==1)
-        os<<" if(ent->Matches(\""<<myNames->Value(ind)->ToCString()<< "\")) return "<<j<<";"<< std::endl;
-      else os<<" else if(ent->Matches(\""<<myNames->Value(ind)->ToCString()<< "\")) return "<<j<<";"<< std::endl;
+      if (j == 1)
+      {
+        os << " if(ent->Matches(\"" << myNames->Value(ind)->ToCString() << "\")) return " << j << ";" << std::endl;
+      }
+      else
+      {
+        os << " else if(ent->Matches(\"" << myNames->Value(ind)->ToCString() << "\")) return " << j << ";" << std::endl;
+      }
     }
-    os<<" else return 0;"<< std::endl;
-    os<<"}"<< std::endl;
-    
+    os << " else return 0;" << std::endl;
+    os << "}" << std::endl;
+
     //write NewMember method
-     Express::WriteMethodStamp ( os, new TCollection_HAsciiString ( "NewMember" ) );
-    os<<"Handle(StepData_SelectMember) "<<CPPname->ToCString()<<"::NewMember() const"<< std::endl;
-    os<<"{"<< std::endl;
-    os<<" return new "<<CPPname->ToCString()<<"Member;"<< std::endl;
-    os<<"}"<< std::endl;
-    
+    Express::WriteMethodStamp(os, new TCollection_HAsciiString("NewMember"));
+    os << "Handle(StepData_SelectMember) " << CPPname->ToCString() << "::NewMember() const" << std::endl;
+    os << "{" << std::endl;
+    os << " return new " << CPPname->ToCString() << "Member;" << std::endl;
+    os << "}" << std::endl;
   }
   
-  
   // write methods Get for entities.
-  for (Standard_Integer i=1; i <= seqEntities->Length(); i++ ) {
+  for (Standard_Integer i = 1; i <= seqEntities->Length(); i++)
+  {
     Standard_Integer ind = seqEntities->Value(i);
     Handle(Express_Item) item = myItems->Value(ind);
-    Express::WriteMethodStamp ( os, item->Name() );
+    Express::WriteMethodStamp(os, item->Name());
     os << "Handle(" << item->CPPName()->ToCString() << ") " << CPPname->ToCString() <<
-          "::" << item->Name()->ToCString() << " () const" << std::endl;
+      "::" << item->Name()->ToCString() << " () const" << std::endl;
     os << "{\n  return Handle(" << item->CPPName()->ToCString() << ")::DownCast(Value());\n}" << std::endl;
   }
   
   //write methods Set and Get for Integer, Real, String and Enum
-  for (Standard_Integer i=1; i <= seqMember->Length(); i++ ) {
+  for (Standard_Integer i = 1; i <= seqMember->Length(); i++)
+  {
     Standard_Integer ind = seqMember->Value(i);
     Handle(Express_Item) item = myItems->Value(ind);
     Handle(TCollection_HAsciiString) stamp = new TCollection_HAsciiString("Set");
     stamp->AssignCat(item->Name());
-    Express::WriteMethodStamp ( os, stamp );
-    
-    Standard_Boolean isString = (item->CPPName()->String().Location("HAsciiString",1,item->CPPName()->Length()) > 0);
+    Express::WriteMethodStamp(os, stamp);
+
+    Standard_Boolean isString = (item->CPPName()->String().Location("HAsciiString", 1, item->CPPName()->Length()) > 0);
     Handle(TCollection_HAsciiString) nameFunc = new TCollection_HAsciiString;
     Handle(TCollection_HAsciiString) Func = new TCollection_HAsciiString;
     Standard_Boolean isEnum = item->IsKind(STANDARD_TYPE(Express_Enum));
-    if(!isEnum) {
-      if(isString)
+    if (!isEnum)
+    {
+      if (isString)
+      {
         Func->AssignCat("String");
-      else {
+      }
+      else
+      {
         nameFunc->AssignCat(item->CPPName());
         Func = nameFunc;
-        Standard_Integer splitind = nameFunc->String().Location("_",1,item->CPPName()->Length());
-        if(splitind)
+        Standard_Integer splitind = nameFunc->String().Location("_", 1, item->CPPName()->Length());
+        if (splitind)
+        {
           Func = nameFunc->Split(splitind);
+        }
       }
     }
-    
+
     //write method set
-    if(isString) {
-      os <<  "void "<<CPPname->ToCString() <<
-        "::" << "Set"<<item->Name()->ToCString() << " (const Handle("<<item->CPPName()->ToCString() << ") &val)" << std::endl;
+    if (isString)
+    {
+      os << "void " << CPPname->ToCString() << "::" << "Set" << item->Name()->ToCString() <<
+        " (const Handle(" << item->CPPName()->ToCString() << ") &val)" << std::endl;
+    }
+    else
+    {
+      os << "void " << CPPname->ToCString() << "::" << "Set" << item->Name()->ToCString() <<
+        " (const " << item->CPPName()->ToCString() << " val)" << std::endl;
     }
-    else  
-      os <<  "void "<<CPPname->ToCString() <<
-          "::" << "Set"<<item->Name()->ToCString() << " (const "<<item->CPPName()->ToCString() << " val)" << std::endl;
 
-    os<<"{"<< std::endl;
-    
-    os<< "  Handle("<<CPPname->ToCString()<<"Member) SelMem = Handle(" << CPPname->ToCString()<<"Member)::DownCast(Value());"<< std::endl;
-    os<<"  if(SelMem.IsNull()) return;"<< std::endl;
-    os<<" Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString(\""<<item->Name()->ToCString()<<"\");"<< std::endl;
-    os<<" SelMem->SetName(name->ToCString());"<< std::endl;
-    if(isEnum) 
-      os<<" SelMem->SetEnum((Standard_Integer)val);"<< std::endl;
-    else if(isString)
-      os<<" SelMem->Set"<<Func->ToCString()<<"(val->ToCString());"<< std::endl;
-    else 
-      os<<" SelMem->Set"<<Func->ToCString()<<"(val);"<< std::endl;
-    
-    os<<"}"<< std::endl;
-    
+    os << "{" << std::endl;
+    os << "  Handle(" << CPPname->ToCString() << "Member) SelMem = Handle(" <<
+      CPPname->ToCString() << "Member)::DownCast(Value());" << std::endl;
+    os << "  if(SelMem.IsNull()) return;" << std::endl;
+    os << " Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString(\"" <<
+      item->Name()->ToCString() << "\");" << std::endl;
+    os << " SelMem->SetName(name->ToCString());" << std::endl;
+    if (isEnum)
+    {
+      os << " SelMem->SetEnum((Standard_Integer)val);" << std::endl;
+    }
+    else if (isString)
+    {
+      os << " SelMem->Set" << Func->ToCString() << "(val->ToCString());" << std::endl;
+    }
+    else
+    {
+      os << " SelMem->Set" << Func->ToCString() << "(val);" << std::endl;
+    }
+    os << "}" << std::endl;
+
     //write method get
-    Express::WriteMethodStamp ( os, item->Name() );
-    if(isString)
-       os << "Handle("<<item->CPPName()->ToCString() << ") "<<CPPname->ToCString() <<
-      "::" << item->Name()->ToCString() << " () const" << std::endl;
-    else 
-      os << item->CPPName()->ToCString() << " "<<CPPname->ToCString() <<
-      "::" << item->Name()->ToCString() << " () const" << std::endl;
-    
-    os<<"{"<< std::endl;
-    os<< "  Handle("<<CPPname->ToCString()<<"Member) SelMem = Handle(" << CPPname->ToCString()<<"Member)::DownCast(Value());"<< std::endl;
-    os<<"  if(SelMem.IsNull()) return 0;"<< std::endl;
-    os<<" Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;"<< std::endl;
-    os<<" name->AssignCat(SelMem->Name());"<< std::endl;
-    os<<" Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString(\""<<item->Name()->ToCString()<<"\");"<< std::endl;
-    os<<" if(name->IsDifferent(nameitem)) return 0;"<< std::endl;
-    if(isEnum) {
+    Express::WriteMethodStamp(os, item->Name());
+    if (isString)
+    {
+      os << "Handle(" << item->CPPName()->ToCString() << ") " << CPPname->ToCString() <<
+        "::" << item->Name()->ToCString() << " () const" << std::endl;
+    }
+    else
+    {
+      os << item->CPPName()->ToCString() << " " << CPPname->ToCString() <<
+        "::" << item->Name()->ToCString() << " () const" << std::endl;
+    }
+
+    os << "{" << std::endl;
+    os << "  Handle(" << CPPname->ToCString() << "Member) SelMem = Handle(" << CPPname->ToCString() <<
+      "Member)::DownCast(Value());" << std::endl;
+    os << "  if(SelMem.IsNull()) return 0;" << std::endl;
+    os << " Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;" << std::endl;
+    os << " name->AssignCat(SelMem->Name());" << std::endl;
+    os << " Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString(\"" <<
+      item->Name()->ToCString() << "\");" << std::endl;
+    os << " if(name->IsDifferent(nameitem)) return 0;" << std::endl;
+    if (isEnum)
+    {
       //nameFunc.AssignCat(item->Name()->ToCString());
-      os<<" Standard_Integer numit = SelMem->Enum();"<< std::endl;
-      os<<"  "<<item->CPPName()->ToCString()<<" val;"<< std::endl;
-      os<<" switch(numit) {"<< std::endl;
+      os << " Standard_Integer numit = SelMem->Enum();" << std::endl;
+      os << "  " << item->CPPName()->ToCString() << " val;" << std::endl;
+      os << " switch(numit) {" << std::endl;
       Handle(Express_Enum) Enum = Handle(Express_Enum)::DownCast(item);
-      Handle(TColStd_HSequenceOfHAsciiString) enitems =  Enum->Names();
+      Handle(TColStd_HSequenceOfHAsciiString) enitems = Enum->Names();
       Handle(TCollection_HAsciiString) prefix = Express::EnumPrefix(item->Name());
-      for(Standard_Integer k = 1; k <= enitems->Length(); k++)
-        os<<"    case "<<k<<" : val = "<<item->Name()->ToCString()<<"_"<<prefix->ToCString()<<enitems->Value(k)->ToCString()<<"; break;"<< std::endl;
-      os<<"    default : return 0;break;"<< std::endl;
-      os<<"  }"<< std::endl;
+      for (Standard_Integer k = 1; k <= enitems->Length(); k++)
+      {
+        os << "    case " << k << " : val = " << item->Name()->ToCString() << "_" << prefix->ToCString() <<
+          enitems->Value(k)->ToCString() << "; break;" << std::endl;
+      }
+      os << "    default : return 0;break;" << std::endl;
+      os << "  }" << std::endl;
     }
-    else if(isString) {
-      os<<" Handle(TCollection_HAsciiString) val = new TCollection_HAsciiString;"<< std::endl;
-      os<<" val->AssignCat(SelMem->String());"<< std::endl;
+    else if (isString)
+    {
+      os << " Handle(TCollection_HAsciiString) val = new TCollection_HAsciiString;" << std::endl;
+      os << " val->AssignCat(SelMem->String());" << std::endl;
     }
-    
-    else 
-      os<<" "<<item->CPPName()->ToCString()<<" val = SelMem->"<<Func->ToCString()<<"();"<< std::endl;
-      
-    
-    os<<" return val;"<< std::endl;
-    os<<"}"<< std::endl;
-      
+    else
+    {
+      os << " " << item->CPPName()->ToCString() << " val = SelMem->" << Func->ToCString() << "();" << std::endl;
+    }
+
+    os << " return val;" << std::endl;
+    os << "}" << std::endl;
+
   }
   // close CXX
   os.close();
-    
+
   return Standard_True;
 }
 //=======================================================================
@@ -432,12 +490,12 @@ Standard_Boolean Express_Select::GenerateClass () const
   os << "class " << CPPname->ToCString() << " : public StepData_SelectNamed" << std::endl;
   os << "{" << std::endl;
   os << "public:" << std::endl;
-  
-   // write methods
+
+  // write methods
   os << "  //! Empty constructor" << std::endl;
   os << "  Standard_EXPORT " << CPPname->ToCString() << "();" << std::endl;
   os << std::endl;
-  
+
   os << "  //! Returns True if has name" << std::endl;
   os << "  Standard_EXPORT virtual Standard_Boolean HasName() const Standard_OVERRIDE;" << std::endl;
   os << std::endl;
@@ -445,15 +503,17 @@ Standard_Boolean Express_Select::GenerateClass () const
   os << "  Standard_EXPORT virtual Standard_CString Name() const Standard_OVERRIDE;" << std::endl;
   os << std::endl;
   os << "  //! Set name" << std::endl;
-  os << "  Standard_EXPORT virtual Standard_Boolean SetName(const Standard_CString name) Standard_OVERRIDE;" << std::endl;
+  os << "  Standard_EXPORT virtual Standard_Boolean SetName(const Standard_CString name) Standard_OVERRIDE;"
+    << std::endl;
   os << std::endl;
   os << "  //! Tells if the name of a SelectMember matches a given one;" << std::endl;
-  os << "  Standard_EXPORT virtual Standard_Boolean Matches(const Standard_CString name) const Standard_OVERRIDE;" << std::endl;
+  os << "  Standard_EXPORT virtual Standard_Boolean Matches(const Standard_CString name) const Standard_OVERRIDE;"
+    << std::endl;
   os << std::endl;
 
   //write fields
-  os <<"private:"<< std::endl;
-  os << "  Standard_Integer myCase;"<< std::endl<< std::endl;
+  os << "private:" << std::endl;
+  os << "  Standard_Integer myCase;" << std::endl << std::endl;
   // write end
   os << "};" << std::endl;
   os << "#endif // _" << CPPname->ToCString() << "_HeaderFile" << std::endl;
@@ -462,101 +522,117 @@ Standard_Boolean Express_Select::GenerateClass () const
   //===============================
   // Step 2: generating CXX
    // Open CXX file 
-  os.open ( pack.Cat ( ".cxx" ).ToCString() );
+  os.open(pack.Cat(".cxx").ToCString());
 
   // write header
-  Express::WriteFileStamp ( os );
+  Express::WriteFileStamp(os);
 
   // write include section
   os << "#include <" << CPPname->ToCString() << ".hxx>" << std::endl;
-  os << "#include <TCollection_HAsciiString.hxx>"<< std::endl;
+  os << "#include <TCollection_HAsciiString.hxx>" << std::endl;
   // write constructor
-  Express::WriteMethodStamp ( os, CPPname );
+  Express::WriteMethodStamp(os, CPPname);
   os << CPPname->ToCString() << "::" << CPPname->ToCString() << " () : myCase(0) " << std::endl;
   os << "{" << std::endl << "}" << std::endl;
-  
+
   //write method HasName
-  Express::WriteMethodStamp ( os, new TCollection_HAsciiString ("HasName") );
-  os<<"Standard_Boolean "<<CPPname->ToCString()<<"::HasName() const"<< std::endl;
+  Express::WriteMethodStamp(os, new TCollection_HAsciiString("HasName"));
+  os << "Standard_Boolean " << CPPname->ToCString() << "::HasName() const" << std::endl;
   os << "{" << std::endl;
-  os<< " return myCase > 0;"<< std::endl;
-  os<< "}" << std::endl;
-  
+  os << " return myCase > 0;" << std::endl;
+  os << "}" << std::endl;
+
   Standard_Boolean hasEnum = Standard_False;
   //write method Name
-  Express::WriteMethodStamp ( os, new TCollection_HAsciiString ("Name") );
-  os<<"Standard_CString "<<CPPname->ToCString()<<"::Name() const"<< std::endl;
+  Express::WriteMethodStamp(os, new TCollection_HAsciiString("Name"));
+  os << "Standard_CString " << CPPname->ToCString() << "::Name() const" << std::endl;
   os << "{" << std::endl;
-  os << "  Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString;"<< std::endl;
-  os << "  switch(myCase)  {"<< std::endl;
+  os << "  Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString;" << std::endl;
+  os << "  switch(myCase)  {" << std::endl;
   Standard_Integer i = 1;
-  for( i = 1; i <= seqMember->Length(); i++) {
+  for (i = 1; i <= seqMember->Length(); i++)
+  {
     Standard_Integer ind = seqMember->Value(i);
     Handle(Express_Item) item = myItems->Value(ind);
-    if(item->IsKind(STANDARD_TYPE(Express_Enum)))
+    if (item->IsKind(STANDARD_TYPE(Express_Enum)))
+    {
       hasEnum = Standard_True;
-    os << "    case "<<i<<"  : aName->AssignCat(\""<<myNames->Value(ind)->ToCString()<<"\"); break;"<< std::endl;
+    }
+    os << "    case " << i << "  : aName->AssignCat(\"" << myNames->Value(ind)->ToCString() << "\"); break;" << std::endl;
   }
-  os << "    default : break;"<< std::endl;
-  os<<"  }"<< std::endl;
-  os<<"  return aName->ToCString();"<< std::endl;
-  os<< "}" << std::endl;
-  
+  os << "    default : break;" << std::endl;
+  os << "  }" << std::endl;
+  os << "  return aName->ToCString();" << std::endl;
+  os << "}" << std::endl;
+
   //write static method for compare name
-  Express::WriteMethodStamp ( os, new TCollection_HAsciiString ("CompareNames") );
-  os<<"static Standard_Integer CompareNames(const Standard_CString name";
-  if(hasEnum)
-    os<<",Standard_Integer &numen) "<< std::endl;
+  Express::WriteMethodStamp(os, new TCollection_HAsciiString("CompareNames"));
+  os << "static Standard_Integer CompareNames(const Standard_CString name";
+  if (hasEnum)
+  {
+    os << ",Standard_Integer &numen) " << std::endl;
+  }
   else
-    os<<")"<< std::endl;
+  {
+    os << ")" << std::endl;
+  }
   os << "{" << std::endl;
-  os << "  Standard_Integer thecase = 0;"<< std::endl;
-  os << "  if (!name || name[0] == \'/0\') thecase = 0;"<< std::endl;
-  for( i = 1; i <= seqMember->Length(); i++) {
+  os << "  Standard_Integer thecase = 0;" << std::endl;
+  os << "  if (!name || name[0] == \'/0\') thecase = 0;" << std::endl;
+  for (i = 1; i <= seqMember->Length(); i++)
+  {
     Standard_Integer ind = seqMember->Value(i);
     Handle(Express_Item) item = myItems->Value(ind);
-    if(item->IsKind(STANDARD_TYPE(Express_Enum))) {
+    if (item->IsKind(STANDARD_TYPE(Express_Enum)))
+    {
       Handle(Express_Enum) en = Handle(Express_Enum)::DownCast(item);
-      for(Standard_Integer k =1 ; k <= en->Names()->Length();k++) {
-         os<<"   else if(!strcmp (name,\""<<en->Names()->Value(k)->ToCString()<<"\")) { "<< std::endl;
-         os<<"     thecase = "<<i<<";"<< std::endl;
-         os<<"     numen =  "<<k<<";"<< std::endl;
-         os<<"   }"<< std::endl; 
-         
+      for (Standard_Integer k = 1; k <= en->Names()->Length(); k++)
+      {
+        os << "   else if(!strcmp (name,\"" << en->Names()->Value(k)->ToCString() << "\")) { " << std::endl;
+        os << "     thecase = " << i << ";" << std::endl;
+        os << "     numen =  " << k << ";" << std::endl;
+        os << "   }" << std::endl;
       }
     }
     else
-      os<<"   else if(!strcmp (name,\""<<myNames->Value(ind)->ToCString()<<"\")) thecase = "<<i<<";"<< std::endl;  
+    {
+      os << "   else if(!strcmp (name,\"" << myNames->Value(ind)->ToCString() << "\")) thecase = " << i << ";" << std::endl;
+    }
   }
-  os << "  return thecase;"<< std::endl;
+  os << "  return thecase;" << std::endl;
   os << "}" << std::endl;
-  
+
   //write method SetName
-  Express::WriteMethodStamp ( os, new TCollection_HAsciiString ("SetName") );
-  os<<"Standard_Boolean "<<CPPname->ToCString()<<"::SetName(const Standard_CString name) "<< std::endl;
+  Express::WriteMethodStamp(os, new TCollection_HAsciiString("SetName"));
+  os << "Standard_Boolean " << CPPname->ToCString() << "::SetName(const Standard_CString name) " << std::endl;
   os << "{" << std::endl;
-  if(hasEnum) {
-    os << "  Standard_Integer numit = 0;"<< std::endl;
-    os << "  myCase = CompareNames(name,numit);"<< std::endl;
-  
-    os << "  if (numit) SetInteger(numit);"<< std::endl;
+  if (hasEnum)
+  {
+    os << "  Standard_Integer numit = 0;" << std::endl;
+    os << "  myCase = CompareNames(name,numit);" << std::endl;
+    os << "  if (numit) SetInteger(numit);" << std::endl;
   }
   else
-    os << "  myCase = CompareNames(name);"<< std::endl;
-  os << "  return (myCase >0);"<< std::endl;
-  
-  os<< "}" << std::endl;
+  {
+    os << "  myCase = CompareNames(name);" << std::endl;
+  }
+  os << "  return (myCase >0);" << std::endl;
+  os << "}" << std::endl;
+
   //write method Matches
-  Express::WriteMethodStamp ( os, new TCollection_HAsciiString ("Matches") );
-  os<<"Standard_Boolean "<<CPPname->ToCString()<<"::Matches(const Standard_CString name) const"<< std::endl;
+  Express::WriteMethodStamp(os, new TCollection_HAsciiString("Matches"));
+  os << "Standard_Boolean " << CPPname->ToCString() << "::Matches(const Standard_CString name) const" << std::endl;
   os << "{" << std::endl;
-  if(hasEnum) {
-    os << "  Standard_Integer numit = 0;"<< std::endl;
-    os<< " Standard_Integer thecase = CompareNames(name,numit);"<< std::endl;
+  if (hasEnum)
+  {
+    os << "  Standard_Integer numit = 0;" << std::endl;
+    os << " Standard_Integer thecase = CompareNames(name,numit);" << std::endl;
   }
   else
-    os<< " Standard_Integer thecase = CompareNames(name);"<< std::endl;
-  os << "  return (thecase > 0);"<< std::endl;
+  {
+    os << " Standard_Integer thecase = CompareNames(name);" << std::endl;
+  }
+  os << "  return (thecase > 0);" << std::endl;
   os << "}" << std::endl;
   return Standard_True;
-}
+ }
index 3113c13694953ad2f22bc8b66000a7d371dc55d1..da8878715ee89f904e921c1327da00b5ea7df8e7 100644 (file)
@@ -30,7 +30,6 @@ class Express_Select : public Express_Item
 {
 
 public:
-
   
   //! Create SELECT item and initialize it
   Standard_EXPORT Express_Select(const Standard_CString name, const Handle(TColStd_HSequenceOfHAsciiString)& names);
@@ -44,31 +43,17 @@ public:
   //! Create HXX/CXX files from item
   Standard_EXPORT virtual   Standard_Boolean GenerateClass()  const Standard_OVERRIDE;
 
-
-
-
   DEFINE_STANDARD_RTTIEXT(Express_Select,Express_Item)
 
 protected:
 
-
-
-
 private: 
-
   
   Standard_EXPORT   Standard_Boolean GenerateSelectMember (const Handle(TColStd_HSequenceOfInteger)& seqMember)  const;
 
   Handle(TColStd_HSequenceOfHAsciiString) myNames;
   Handle(Express_HSequenceOfItem) myItems;
 
-
 };
 
-
-
-
-
-
-
 #endif // _Express_Select_HeaderFile
index 42e4d717214fe0cb1a7dd7f6e16838fe47ce2fe9..621e6dd1a18537ebc6ea1ead79b3317e0760bea8 100644 (file)
@@ -19,5 +19,4 @@
 
 typedef NCollection_Sequence<Handle(Express_Entity)> Express_SequenceOfEntity;
 
-
 #endif
index 69e67a9f46cfe1ccffeb1edce74b2e0c659e23d8..77f615058512430f7efae3b9cedbb8f433d103a1 100644 (file)
@@ -19,5 +19,4 @@
 
 typedef NCollection_Sequence<Handle(Express_Field)> Express_SequenceOfField;
 
-
 #endif
index 66ad4d515ba66694f8f729578ef3401ee541b6ad..4ab9afd9eab33cabcf725ae2f90dad0f53af8b89 100644 (file)
@@ -19,5 +19,4 @@
 
 typedef NCollection_Sequence<Handle(Express_Item)> Express_SequenceOfItem;
 
-
 #endif
index 09c2af920ed33eb631f0a6b2c937a8e84b1b7153..55be6b9b2c57541c8e2f0833a8e013196e69fc17 100644 (file)
 #define _Express_String_HeaderFile
 
 #include <Standard_Type.hxx>
-
 #include <Express_PredefinedType.hxx>
-
 class TCollection_HAsciiString;
 
-
 //! Implements EXPRESS type 'STRING'
 class Express_String : public Express_PredefinedType
 {
 
 public:
 
-  
   //! Empty constructor
   Standard_EXPORT Express_String();
   
@@ -37,27 +33,12 @@ public:
   //! Returns False
   Standard_EXPORT virtual   Standard_Boolean IsStandard()  const Standard_OVERRIDE;
 
-
-
-
   DEFINE_STANDARD_RTTIEXT(Express_String,Express_PredefinedType)
 
 protected:
 
-
-
-
 private: 
 
-
-
-
 };
 
-
-
-
-
-
-
 #endif // _Express_String_HeaderFile
index 77a7db8da1da3c8415e93d59473fe9f371ef5bba..f7b37ea475c3804f82eaceb3e48036f5b6c58382 100644 (file)
@@ -61,8 +61,9 @@ Standard_Boolean Express_Type::IsHandle () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Express_Type::Use (const Handle(TCollection_HAsciiString) &,
-                                    const Standard_Boolean ) const
+Standard_Boolean Express_Type::Use(
+  const Handle(TCollection_HAsciiString) &,
+  const Standard_Boolean ) const
 {
   return Standard_False;
 }
index 2268d0e3862fbe8db6731173988318e7446a048b..0053edb45dc9a6d95d771549404353350565ac31 100644 (file)
@@ -24,7 +24,6 @@ class Express_Type : public Standard_Transient
 {
 
 public:
-
   
   //! Returns CPP-style name of the type
   Standard_EXPORT virtual   Handle(TCollection_HAsciiString) CPPName()  const = 0;
@@ -43,32 +42,19 @@ public:
   //! Declares type as used by some item being generated.
   //! Calls Use() for all referred types and schema items.
   //! Default instantiation does nothing
-  Standard_EXPORT virtual   Standard_Boolean Use (const Handle(TCollection_HAsciiString)& pack, const Standard_Boolean defer = Standard_False)  const;
-
-
-
+  Standard_EXPORT virtual   Standard_Boolean Use(
+    const Handle(TCollection_HAsciiString)& pack,
+    const Standard_Boolean defer = Standard_False)  const;
 
   DEFINE_STANDARD_RTTIEXT(Express_Type,Standard_Transient)
 
 protected:
-
   
   //! Empty constructor
   Standard_EXPORT Express_Type();
 
-
-
 private: 
 
-
-
-
 };
 
-
-
-
-
-
-
 #endif // _Express_Type_HeaderFile