]> OCCT Git - occt-copy.git/commitdiff
Redundant classes from StepData was removed CR0_720_ISC
authorgka <gka@opencascade.com>
Wed, 30 Aug 2017 13:19:53 +0000 (16:19 +0300)
committergka <gka@opencascade.com>
Fri, 27 Oct 2017 08:07:14 +0000 (11:07 +0300)
66 files changed:
src/HeaderSection/FILES
src/HeaderSection/HeaderSection.cxx
src/HeaderSection/HeaderSection_HeaderRecognizer.cxx [deleted file]
src/HeaderSection/HeaderSection_HeaderRecognizer.hxx [deleted file]
src/HeaderSection/HeaderSection_Protocol.cxx
src/IFSelect/IFSelect_WorkSession.cxx
src/Interface/Interface_InterfaceModel.cxx
src/Interface/Interface_InterfaceModel.hxx
src/QABugs/QABugs_11.cxx
src/RWHeaderSection/RWHeaderSection.cxx
src/RWHeaderSection/RWHeaderSection_ReadWriteModule.cxx
src/RWStepAP214/RWStepAP214.cxx
src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx
src/RWStepAP214/RWStepAP214_ReadWriteModule.hxx
src/STEPCAFControl/STEPCAFControl_Reader.cxx
src/STEPCAFControl/STEPCAFControl_Writer.cxx
src/STEPCAFControl/STEPCAFControl_Writer.hxx
src/STEPConstruct/STEPConstruct_ContextTool.cxx
src/STEPConstruct/STEPConstruct_Part.cxx
src/STEPConstruct/STEPConstruct_Styles.cxx
src/STEPConstruct/STEPConstruct_UnitContext.cxx
src/STEPConstruct/STEPConstruct_ValidationProps.cxx
src/STEPControl/STEPControl_ActorRead.cxx
src/STEPControl/STEPControl_ActorWrite.cxx
src/STEPControl/STEPControl_Controller.cxx
src/STEPControl/STEPControl_Reader.cxx
src/StepAP214/StepAP214_Protocol.cxx
src/StepData/StepData.cxx
src/StepData/StepData.hxx
src/StepData/StepData_DescrGeneral.cxx [deleted file]
src/StepData/StepData_DescrGeneral.hxx [deleted file]
src/StepData/StepData_DescrProtocol.cxx [deleted file]
src/StepData/StepData_DescrProtocol.hxx [deleted file]
src/StepData/StepData_DescrReadWrite.cxx [deleted file]
src/StepData/StepData_DescrReadWrite.hxx [deleted file]
src/StepData/StepData_FileProtocol.cxx [deleted file]
src/StepData/StepData_FileProtocol.hxx [deleted file]
src/StepData/StepData_HeaderTool.cxx [deleted file]
src/StepData/StepData_HeaderTool.hxx [deleted file]
src/StepData/StepData_StepModel.cxx
src/StepData/StepData_StepModel.hxx
src/StepData/StepData_StepReaderTool.hxx
src/StepSelect/StepSelect_StepType.cxx
src/StepToTopoDS/StepToTopoDS_Builder.cxx
src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.cxx
src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx
src/TopoDSToStep/TopoDSToStep_MakeBrepWithVoids.cxx
src/TopoDSToStep/TopoDSToStep_MakeFacetedBrep.cxx
src/TopoDSToStep/TopoDSToStep_MakeFacetedBrepAndBrepWithVoids.cxx
src/TopoDSToStep/TopoDSToStep_MakeGeometricCurveSet.cxx
src/TopoDSToStep/TopoDSToStep_MakeManifoldSolidBrep.cxx
src/TopoDSToStep/TopoDSToStep_MakeShellBasedSurfaceModel.cxx
src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx
src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx
src/TopoDSToStep/TopoDSToStep_MakeStepVertex.cxx
src/XSAlgo/XSAlgo_AlgoContainer.cxx
src/XSAlgo/XSAlgo_AlgoContainer.hxx
src/XSControl/XSControl_Controller.cxx
src/XSControl/XSControl_Controller.hxx
src/XSControl/XSControl_Functions.cxx
src/XSControl/XSControl_WorkSession.cxx
src/XSControl/XSControl_WorkSession.hxx
src/XSDRAWIGES/XSDRAWIGES.cxx
src/XSDRAWSTEP/XSDRAWSTEP.cxx
tests/de/step_1/R9
tests/de/step_3/F3

index 38178e8905f7cf1d81b2eef22dd66692fab78dc0..4949ebd272bc18e39af81e4506c837f27729d834 100644 (file)
@@ -6,7 +6,5 @@ HeaderSection_FileName.cxx
 HeaderSection_FileName.hxx
 HeaderSection_FileSchema.cxx
 HeaderSection_FileSchema.hxx
-HeaderSection_HeaderRecognizer.cxx
-HeaderSection_HeaderRecognizer.hxx
 HeaderSection_Protocol.cxx
 HeaderSection_Protocol.hxx
index c31429e501413d6e57b249e568292c42bb226449..fe89a9b711cc52b22f93ff77e5de93ee4560cca4 100644 (file)
 #include <HeaderSection_Protocol.hxx>
 #include <Interface_Statics.hxx>
 
-StaticHandle(HeaderSection_Protocol, proto);
+//StaticHandle(HeaderSection_Protocol, proto);
 
 Handle(HeaderSection_Protocol) HeaderSection::Protocol()
 
-       {
-               InitHandleVoid(HeaderSection_Protocol, proto);
-               return proto;
-       }
+{
+               //InitHandleVoid(HeaderSection_Protocol, proto);
+  return new HeaderSection_Protocol;
+}
 
diff --git a/src/HeaderSection/HeaderSection_HeaderRecognizer.cxx b/src/HeaderSection/HeaderSection_HeaderRecognizer.cxx
deleted file mode 100644 (file)
index 47e6ce8..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-// Created on: 1994-06-27
-// Created by: Frederic MAUPAS
-// Copyright (c) 1994-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-
-#include <HeaderSection_FileDescription.hxx>
-#include <HeaderSection_FileName.hxx>
-#include <HeaderSection_FileSchema.hxx>
-#include <HeaderSection_HeaderRecognizer.hxx>
-#include <Standard_Type.hxx>
-#include <TCollection_AsciiString.hxx>
-
-IMPLEMENT_STANDARD_RTTIEXT(HeaderSection_HeaderRecognizer,StepData_FileRecognizer)
-
-static TCollection_AsciiString reco_FileName    ("FILE_NAME");
-static TCollection_AsciiString reco_FileSchema ("FILE_SCHEMA");
-static TCollection_AsciiString reco_FileDescription ("FILE_DESCRIPTION");
-
-
-
-HeaderSection_HeaderRecognizer::HeaderSection_HeaderRecognizer ()
-{ }
-
-void HeaderSection_HeaderRecognizer::Eval
-  (const TCollection_AsciiString& key)
-{
-  if (key.IsEqual(reco_FileName)) { 
-    SetOK(new HeaderSection_FileName);
-    return;
-  }
-  if (key.IsEqual(reco_FileSchema)) { 
-    SetOK(new HeaderSection_FileSchema);
-    return;
-  }
-  if (key.IsEqual(reco_FileDescription)) { 
-    SetOK(new HeaderSection_FileDescription);
-    return;
-  } 
-}
diff --git a/src/HeaderSection/HeaderSection_HeaderRecognizer.hxx b/src/HeaderSection/HeaderSection_HeaderRecognizer.hxx
deleted file mode 100644 (file)
index 6fdba9b..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-// Created on: 1994-06-27
-// Created by: Frederic MAUPAS
-// Copyright (c) 1994-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _HeaderSection_HeaderRecognizer_HeaderFile
-#define _HeaderSection_HeaderRecognizer_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <StepData_FileRecognizer.hxx>
-class TCollection_AsciiString;
-
-
-class HeaderSection_HeaderRecognizer;
-DEFINE_STANDARD_HANDLE(HeaderSection_HeaderRecognizer, StepData_FileRecognizer)
-
-//! Recognizes STEP Standard Header Entities
-//! (FileName, FileDescription, FileSchema)
-class HeaderSection_HeaderRecognizer : public StepData_FileRecognizer
-{
-
-public:
-
-  
-  Standard_EXPORT HeaderSection_HeaderRecognizer();
-
-
-
-
-  DEFINE_STANDARD_RTTIEXT(HeaderSection_HeaderRecognizer,StepData_FileRecognizer)
-
-protected:
-
-  
-  //! Recognizes data types of Header STEP Standard
-  Standard_EXPORT void Eval (const TCollection_AsciiString& key) Standard_OVERRIDE;
-
-
-
-private:
-
-
-
-
-};
-
-
-
-
-
-
-
-#endif // _HeaderSection_HeaderRecognizer_HeaderFile
index dce01ced17a428f62fccf15a1337ce31cae5feb8..dc5403b507685c7468fb5d0ffc1622c421bbe923 100644 (file)
@@ -21,7 +21,7 @@
 
 IMPLEMENT_STANDARD_RTTIEXT(HeaderSection_Protocol,StepData_Protocol)
 
-static Standard_CString schemaName = "header_section";
+//static Standard_CString schemaName = "header_section";
 
 HeaderSection_Protocol::HeaderSection_Protocol () { }
 
@@ -36,4 +36,4 @@ Handle(Standard_Type)& atype) const
 }
 
 Standard_CString HeaderSection_Protocol::SchemaName(Standard_Integer /*theShematype*/)
-       {       return schemaName; }
+       {       return "header_section"; }
index c514f68f850b4c80ee38812007f92e4268610010..4d9479f008c315015e33b2b8a426b39a74840e01 100644 (file)
@@ -541,25 +541,25 @@ Standard_Boolean IFSelect_WorkSession::ComputeCheck
   if (thecheckdone) return Standard_True;
   if (!IsLoaded()) return Standard_False;
 
-  //Interface_Graph& CG = thegraph->CGraph();
-  //Interface_CheckTool cht(thegraph);
-  //Interface_CheckIterator checklist = cht.VerifyCheckList();
-  //myModel->FillSemanticChecks(checklist,Standard_False);
-  //if(themodelstat)
-  //{
-  //  //  Et on met a jour le Graphe (BitMap) !  Flag Incorrect (STX + SEM)
-  //  Interface_BitMap& BM = CG.CBitMap();
-  //  BM.Init (Standard_False,Flag_Incorrect);
-  //  Standard_Integer num, nb = CG.Size();
-  //  for (checklist.Start(); checklist.More(); checklist.Next()) {
-  //    const Handle(Interface_Check) chk = checklist.Value();
-  //    if (!chk->HasFailed()) continue;
-  //    num = checklist.Number();
-  //    if (num > 0 && num <= nb) BM.SetTrue (num,Flag_Incorrect);
-  //  }
-  //  for (num = 1; num <= nb; num ++)
-  //    if (myModel->IsErrorEntity (num)) BM.SetTrue (num,Flag_Incorrect);
-  //}
+  Interface_Graph& CG = thegraph->CGraph();
+  Interface_CheckTool cht(thegraph);
+  Interface_CheckIterator checklist = cht.VerifyCheckList();
+  myModel->FillSemanticChecks(checklist,Standard_False);
+  if(themodelstat)
+  {
+    //  Et on met a jour le Graphe (BitMap) !  Flag Incorrect (STX + SEM)
+    Interface_BitMap& BM = CG.CBitMap();
+    BM.Init (Standard_False,Flag_Incorrect);
+    Standard_Integer num, nb = CG.Size();
+    for (checklist.Start(); checklist.More(); checklist.Next()) {
+      const Handle(Interface_Check) chk = checklist.Value();
+      if (!chk->HasFailed()) continue;
+      num = checklist.Number();
+      if (num > 0 && num <= nb) BM.SetTrue (num,Flag_Incorrect);
+    }
+    for (num = 1; num <= nb; num ++)
+      if (myModel->IsErrorEntity (num)) BM.SetTrue (num,Flag_Incorrect);
+  }
   return Standard_True;
 }
 
index e5415b21b6aae566e71e01ab3854db1c673714c9..a4e52cfc2194a52994ae6e6d3a6142dfea260ca4 100644 (file)
@@ -1046,15 +1046,8 @@ Handle(TColStd_HSequenceOfHAsciiString) Interface_InterfaceModel::ListTemplates
 //purpose  : 
 //=======================================================================
 Handle(Interface_Static) Interface_InterfaceModel::GetParam
-(const Standard_CString theParamName)
+(const Standard_CString theParamName) const
 {
-  /*if (IsEqual(theParamName, "write.step.schema"))
-  {
-    Handle(Standard_Transient) result;
-    myParamMap.Find(theParamName, result);
-    Standard_Integer anInt = Handle(Interface_Static)::DownCast(result)->IntegerValue();
-
-  }*/
   Handle(Interface_Static) aParam;
   if (myParamMap.IsBound(theParamName))
   {
@@ -1063,6 +1056,12 @@ Handle(Interface_Static) Interface_InterfaceModel::GetParam
     if (!result.IsNull())
       aParam = Handle(Interface_Static)::DownCast(result);
   }
+  if (aParam.IsNull())
+  {
+#ifdef OCCT_DEBUG
+    cout << "Warning: Incorrect parameter :" << name << endl;
+#endif
+  }
   return aParam;
 }
 
@@ -1083,3 +1082,33 @@ const NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)>&
 {
   return myParamMap;
 }
+
+//=======================================================================
+//function : IVal
+//purpose  : 
+//=======================================================================
+Standard_Integer Interface_InterfaceModel::IVal(const Standard_CString theParamName) const
+{
+  Handle(Interface_Static) aParam = GetParam(theParamName);
+  return (aParam.IsNull() ? 0 : aParam->IntegerValue());
+}
+
+//=======================================================================
+//function : RVal
+//purpose  : 
+//=======================================================================
+Standard_Real Interface_InterfaceModel::RVal(const Standard_CString theParamName) const
+{
+  Handle(Interface_Static) aParam = GetParam(theParamName);
+  return (aParam.IsNull() ? 0.0 : aParam->RealValue());
+}
+
+//=======================================================================
+//function : CVal
+//purpose  : 
+//=======================================================================
+Standard_CString Interface_InterfaceModel::CVal(const Standard_CString theParamName) const
+{
+  Handle(Interface_Static) aParam = GetParam(theParamName);
+  return (aParam.IsNull() ? "" : aParam->CStringValue());
+}
index 027aa73417e6641f0c88d689a529664c69d2884b..dee096511193466f5be373080811ef87b98b0eb6 100644 (file)
@@ -400,7 +400,11 @@ public:
   Standard_EXPORT static Handle(TColStd_HSequenceOfHAsciiString) ListTemplates();
 
   //! Returns parameter for translation by its name
-  Standard_EXPORT Handle(Interface_Static) GetParam(const Standard_CString theParamName);
+  Standard_EXPORT Handle(Interface_Static) GetParam(const Standard_CString theParamName) const;
+
+  Standard_EXPORT Standard_Integer IVal(const Standard_CString theParamName) const;
+  Standard_EXPORT Standard_Real RVal(const Standard_CString theParamName) const;
+  Standard_EXPORT Standard_CString CVal(const Standard_CString theParamName) const;
 
   //! Adds parameters in the mopdel
   Standard_EXPORT void AddParam(const Standard_CString theParamName, Handle(Interface_Static)& theParam);
index 3e215861f0d9762d21ac93fd5ac7314f5e99b5a8..8bbeac6004b55b673c57e5f477079c6db493baa0 100644 (file)
@@ -89,6 +89,7 @@
 #include <BRepFeat_SplitShape.hxx>
 #include <BRepAlgoAPI_Section.hxx>
 #include <TColStd_PackedMapOfInteger.hxx>
+#include <StepData_StepModel.hxx>
 
 #if ! defined(_WIN32)
 extern ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS();
@@ -2549,10 +2550,13 @@ static Standard_Integer OCC7141 (Draw_Interpretor& di, Standard_Integer argc, co
   shapeTool = XCAFDoc_DocumentTool::ShapeTool(document->Main());
   shapeTool->AddShape(AddTestStructure(nCount), Standard_True);
   STEPControl_StepModelType mode = STEPControl_AsIs;
-  if (!writer.GetParam("write.step.assembly")->SetIntegerValue(1)) { //assembly mode
+  Handle(StepData_StepModel) aModel =writer.ChangeWriter().Model();
+  Handle(Interface_Static) aParam = aModel->GetParam("write.step.assembly");
+  if (aParam.IsNull()) { //assembly mode
     di << "Failed to set assembly mode for step data\n\n";
     return 0;
   }
+  aParam->SetIntegerValue(1);
   try {
     OCC_CATCH_SIGNALS
     if( writer.Transfer(document, mode)) {
index d1e0cbc598ad951ccf4138fe554701b992a8ebc4..65f875ceb27364579020921e0fde3e814acfbe72 100644 (file)
@@ -25,15 +25,11 @@ static Handle(RWHeaderSection_GeneralModule) rwg;
 static int THE_RWHeaderSection_init = 0;
 
 
+
 void RWHeaderSection::Init()
 {
-  if (THE_RWHeaderSection_init)
-  {
-    return;
-  }
-  THE_RWHeaderSection_init = 1;
-///   EuclidStandard::Init();
-  Handle(HeaderSection_Protocol) proto = HeaderSection::Protocol();
+  Handle(HeaderSection_Protocol) proto = new HeaderSection_Protocol;
   StepData::AddHeaderProtocol(proto);
   if (rwm.IsNull()) rwm = new RWHeaderSection_ReadWriteModule;
   if (rwg.IsNull()) rwg = new RWHeaderSection_GeneralModule;
index 4957a2e2b7caecf13a5dc5a1a34f43399594f10b..ad47c5893b5007586afe133ef0d14ab9d8cb4b6b 100644 (file)
 IMPLEMENT_STANDARD_RTTIEXT(RWHeaderSection_ReadWriteModule,StepData_ReadWriteModule)
 
 // -- General Declarations (Recognize, StepType) ---
-static TCollection_AsciiString PasReco("");    // neutralise StartEntity de SW
-static TCollection_AsciiString Reco_FileName ("FILE_NAME");
-static TCollection_AsciiString Reco_FileDescription ("FILE_DESCRIPTION");
-static TCollection_AsciiString Reco_FileSchema ("FILE_SCHEMA");
+TCollection_AsciiString PasReco("");    // neutralise StartEntity de SW
+TCollection_AsciiString Reco_FileName ("FILE_NAME");
+TCollection_AsciiString Reco_FileDescription ("FILE_DESCRIPTION");
+TCollection_AsciiString Reco_FileSchema ("FILE_SCHEMA");
 
        // -- Definition of the libraries --
 
index fa2873566fbf883c3f2ade9dcd702c08077444fc..862f721e589db4a52af319b4b02d8b345956ad71 100644 (file)
@@ -25,8 +25,8 @@ static int THE_RWStepAP214_init = 0;
 
 void RWStepAP214::Init(const Handle(StepAP214_Protocol)& theProto)
 {
// static Standard_Mutex aPars;
// {
+  static Standard_Mutex aPars;
+  {
 
     if (THE_RWStepAP214_init)
     {
@@ -37,5 +37,5 @@ void RWStepAP214::Init(const Handle(StepAP214_Protocol)& theProto)
     Interface_GeneralLib::SetGlobal(new RWStepAP214_GeneralModule, theProto);
     Interface_ReaderLib::SetGlobal(new RWStepAP214_ReadWriteModule, theProto);
     StepData_WriterLib::SetGlobal(new RWStepAP214_ReadWriteModule, theProto);
// }
+  }
 }
index 185a1e5342930db070e023bacecc48205164d743..5d3fb06918e5beb167205a60fd5964ac125267ba 100644 (file)
@@ -2048,8 +2048,8 @@ static TCollection_AsciiString Reco_CameraModelD3MultiClippingIntersection("CAME
 static TCollection_AsciiString Reco_CameraModelD3MultiClippingUnion("CAMERA_MODEL_D3_MULTI_CLIPPING_UNION");
 // -- Definition of the libraries --
 
-static NCollection_DataMap<TCollection_AsciiString, Standard_Integer> typenums;
-static NCollection_DataMap<TCollection_AsciiString, Standard_Integer> typeshor;
+//static NCollection_DataMap<TCollection_AsciiString, Standard_Integer> typenums;
+//static NCollection_DataMap<TCollection_AsciiString, Standard_Integer> typeshor;
 
 RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule ()
 {
index 75c02ceb21b21c67517906099bff85c453157ea4..bba05e987f0fde4a5a8c8915a242b128c02fa1e4 100644 (file)
@@ -24,7 +24,8 @@
 #include <Standard_Integer.hxx>
 #include <TColStd_SequenceOfAsciiString.hxx>
 #include <Standard_Boolean.hxx>
-class TCollection_AsciiString;
+#include <NCollection_DataMap.hxx>
+#include <TCollection_AsciiString.hxx>
 class StepData_StepReaderData;
 class Interface_Check;
 class Standard_Transient;
@@ -76,7 +77,8 @@ protected:
 
 private:
 
-
+  NCollection_DataMap<TCollection_AsciiString, Standard_Integer> typenums;
+  NCollection_DataMap<TCollection_AsciiString, Standard_Integer> typeshor;
 
 
 };
index 592c6ffa1c94f6cb9fee563d9111293e046a0d1a..b53454c8098dbc627a28a4fbb27e44a0846726de 100644 (file)
@@ -4394,7 +4394,7 @@ void STEPCAFControl_Reader::ExpandSubShapes(const Handle(XCAFDoc_ShapeTool)& Sha
   TColStd_MapOfTransient aRepItems;
 
   // Read translation control variables
-  Standard_Boolean doReadSNames = (myReader.Model()->GetParam("read.stepcaf.subshapes.name")->IntegerValue() > 0);
+  Standard_Boolean doReadSNames = (myReader.Model()->IVal("read.stepcaf.subshapes.name") > 0);
 
   if ( !doReadSNames )
     return;
index d151d62987030e65a240af0ffcc20ada3c267ab9..75ed54d16cc5987d55d738b9d740e1e9fc554068 100644 (file)
 //function : GetLabelName
 //purpose  : auxilary function: take name of label and append it to str
 //=======================================================================
-static Standard_Boolean GetLabelName (const TDF_Label &L, Handle(TCollection_HAsciiString) &str)
+static Standard_Boolean GetLabelName(const TDF_Label &L, Handle(TCollection_HAsciiString) &str)
 {
   Handle(TDataStd_Name) N;
-  if ( ! L.FindAttribute ( TDataStd_Name::GetID(), N ) ) return Standard_False;
+  if (!L.FindAttribute(TDataStd_Name::GetID(), N)) return Standard_False;
   TCollection_ExtendedString name = N->Get();
-  if ( name.Length() <=0 ) return Standard_False;
+  if (name.Length() <= 0) return Standard_False;
 
   // set name, converting it to Ascii and removing spaces
-  TCollection_AsciiString buf ( name, '?' );
+  TCollection_AsciiString buf(name, '?');
   buf.LeftAdjust();
   buf.RightAdjust();
-  buf.ChangeAll(' ','_');
-  str->AssignCat ( buf.ToCString() );
+  buf.ChangeAll(' ', '_');
+  str->AssignCat(buf.ToCString());
   return Standard_True;
 }
 
@@ -269,14 +269,14 @@ static Standard_Boolean GetLabelName (const TDF_Label &L, Handle(TCollection_HAs
 //purpose  :
 //=======================================================================
 
-STEPCAFControl_Writer::STEPCAFControl_Writer () :
-       myColorMode( Standard_True ),
-       myNameMode ( Standard_True ),
-       myLayerMode( Standard_True ),
-       myPropsMode( Standard_True ),
-       mySHUOMode ( Standard_True ),
-       myDGTMode  ( Standard_True ),
-       myMatMode  ( Standard_True )
+STEPCAFControl_Writer::STEPCAFControl_Writer() :
+  myColorMode(Standard_True),
+  myNameMode(Standard_True),
+  myLayerMode(Standard_True),
+  myPropsMode(Standard_True),
+  mySHUOMode(Standard_True),
+  myDGTMode(Standard_True),
+  myMatMode(Standard_True)
 {
   Init(new XSControl_WorkSession, new STEPCAFControl_Controller);
 }
@@ -287,15 +287,15 @@ STEPCAFControl_Writer::STEPCAFControl_Writer () :
 //purpose  :
 //=======================================================================
 
-STEPCAFControl_Writer::STEPCAFControl_Writer (const Handle(XSControl_WorkSession)& theWS,
-                                              const Standard_Boolean theScratch) :
-       myColorMode(Standard_True),
-       myNameMode(Standard_True),
-       myLayerMode(Standard_True),
-       myPropsMode(Standard_True),
-       mySHUOMode(Standard_True),
-       myDGTMode(Standard_True),
-       myMatMode(Standard_True)
+STEPCAFControl_Writer::STEPCAFControl_Writer(const Handle(XSControl_WorkSession)& theWS,
+  const Standard_Boolean theScratch) :
+  myColorMode(Standard_True),
+  myNameMode(Standard_True),
+  myLayerMode(Standard_True),
+  myPropsMode(Standard_True),
+  mySHUOMode(Standard_True),
+  myDGTMode(Standard_True),
+  myMatMode(Standard_True)
 {
   Init(theWS, new STEPCAFControl_Controller, theScratch);
 }
@@ -305,15 +305,15 @@ STEPCAFControl_Writer::STEPCAFControl_Writer (const Handle(XSControl_WorkSession
 //purpose  : 
 //=======================================================================
 STEPCAFControl_Writer::STEPCAFControl_Writer(const Handle(XSControl_WorkSession)& theWS,
-                                             const Handle(XSControl_Controller)& theController,
-                                             const Standard_Boolean theScratch) :
-       myColorMode(Standard_True),
-       myNameMode(Standard_True),
-       myLayerMode(Standard_True),
-       myPropsMode(Standard_True),
-       mySHUOMode(Standard_True),
-       myDGTMode(Standard_True),
-       myMatMode(Standard_True)
+  const Handle(XSControl_Controller)& theController,
+  const Standard_Boolean theScratch) :
+  myColorMode(Standard_True),
+  myNameMode(Standard_True),
+  myLayerMode(Standard_True),
+  myPropsMode(Standard_True),
+  mySHUOMode(Standard_True),
+  myDGTMode(Standard_True),
+  myMatMode(Standard_True)
 {
   Init(theWS, theController, theScratch);
 }
@@ -324,8 +324,8 @@ STEPCAFControl_Writer::STEPCAFControl_Writer(const Handle(XSControl_WorkSession)
 //=======================================================================
 
 void STEPCAFControl_Writer::Init(const Handle(XSControl_WorkSession)& theWS,
-                                 const Handle(XSControl_Controller)& theController,
-                                 const Standard_Boolean theScratch)
+  const Handle(XSControl_Controller)& theController,
+  const Standard_Boolean theScratch)
 {
   myCAFController = Handle(STEPCAFControl_Controller)::DownCast(theController);
   STEPControl_Writer aWriter(theWS, theController, theScratch);
@@ -344,30 +344,30 @@ void STEPCAFControl_Writer::Init(const Handle(XSControl_WorkSession)& theWS,
 //purpose  :
 //=======================================================================
 
-IFSelect_ReturnStatus STEPCAFControl_Writer::Write (const Standard_CString filename)
+IFSelect_ReturnStatus STEPCAFControl_Writer::Write(const Standard_CString filename)
 {
-  IFSelect_ReturnStatus status = myWriter.Write ( filename );
+  IFSelect_ReturnStatus status = myWriter.Write(filename);
 
   // get directory name of the main file
-  OSD_Path mainfile ( filename );
-  mainfile.SetName ( "" );
-  mainfile.SetExtension ( "" );
+  OSD_Path mainfile(filename);
+  mainfile.SetName("");
+  mainfile.SetExtension("");
   TCollection_AsciiString dpath;
-  mainfile.SystemName ( dpath );
+  mainfile.SystemName(dpath);
 
   NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)>::Iterator it(myFiles);
-  for ( ; it.More(); it.Next() ) {
+  for (; it.More(); it.Next()) {
     Handle(STEPCAFControl_ExternFile) EF = it.Value();
-    if ( EF->GetWriteStatus() != IFSelect_RetVoid ) continue;
+    if (EF->GetWriteStatus() != IFSelect_RetVoid) continue;
 
     // construct extern file name
-    TCollection_AsciiString fname = OSD_Path::AbsolutePath ( dpath, EF->GetName()->String() );
-    if ( fname.Length() <= 0 ) fname = EF->GetName()->String();
+    TCollection_AsciiString fname = OSD_Path::AbsolutePath(dpath, EF->GetName()->String());
+    if (fname.Length() <= 0) fname = EF->GetName()->String();
 #ifdef OCCT_DEBUG
     cout << "Writing external file: " << fname.ToCString() << endl;
 #endif
-    
-    EF->SetWriteStatus ( EF->GetWS()->SendAll ( fname.ToCString() ) );
+
+    EF->SetWriteStatus(EF->GetWS()->SendAll(fname.ToCString()));
   }
 
   return status;
@@ -379,16 +379,16 @@ IFSelect_ReturnStatus STEPCAFControl_Writer::Write (const Standard_CString filen
 //purpose  :
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::Transfer( const Handle(TDocStd_Document) &doc,
-                                                 const STEPControl_StepModelType mode,
-                                                 const Standard_CString multi )
+Standard_Boolean STEPCAFControl_Writer::Transfer(const Handle(TDocStd_Document) &doc,
+  const STEPControl_StepModelType mode,
+  const Standard_CString multi)
 {
-  Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool( doc->Main() );
-  if ( STool.IsNull() ) return Standard_False;
+  Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool(doc->Main());
+  if (STool.IsNull()) return Standard_False;
 
   TDF_LabelSequence labels;
-  STool->GetFreeShapes ( labels );
-  return Transfer ( myWriter, labels, mode, multi );
+  STool->GetFreeShapes(labels);
+  return Transfer(myWriter, labels, mode, multi);
 }
 
 
@@ -397,13 +397,13 @@ Standard_Boolean STEPCAFControl_Writer::Transfer( const Handle(TDocStd_Document)
 //purpose  :
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::Transfer( const TDF_Label& L,
-                                                 const STEPControl_StepModelType mode,
-                                                 const Standard_CString multi )
+Standard_Boolean STEPCAFControl_Writer::Transfer(const TDF_Label& L,
+  const STEPControl_StepModelType mode,
+  const Standard_CString multi)
 {
   TDF_LabelSequence labels;
-  labels.Append ( L );
-  return Transfer ( myWriter, labels, mode, multi );
+  labels.Append(L);
+  return Transfer(myWriter, labels, mode, multi);
 }
 
 //=======================================================================
@@ -411,11 +411,11 @@ Standard_Boolean STEPCAFControl_Writer::Transfer( const TDF_Label& L,
 //purpose  :
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::Transfer( const TDF_LabelSequence& labels,
-                                                 const STEPControl_StepModelType mode,
-                                                 const Standard_CString multi )
+Standard_Boolean STEPCAFControl_Writer::Transfer(const TDF_LabelSequence& labels,
+  const STEPControl_StepModelType mode,
+  const Standard_CString multi)
 {
-  return Transfer( myWriter, labels, mode, multi );
+  return Transfer(myWriter, labels, mode, multi);
 }
 
 //=======================================================================
@@ -423,11 +423,11 @@ Standard_Boolean STEPCAFControl_Writer::Transfer( const TDF_LabelSequence& label
 //purpose  :
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::Perform (const Handle(TDocStd_Document) &doc,
-                                                const Standard_CString filename)
+Standard_Boolean STEPCAFControl_Writer::Perform(const Handle(TDocStd_Document) &doc,
+  const Standard_CString filename)
 {
-  if ( ! Transfer ( doc ) ) return Standard_False;
-  return Write ( filename ) == IFSelect_RetDone;
+  if (!Transfer(doc)) return Standard_False;
+  return Write(filename) == IFSelect_RetDone;
 }
 
 
@@ -436,11 +436,11 @@ Standard_Boolean STEPCAFControl_Writer::Perform (const Handle(TDocStd_Document)
 //purpose  :
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::Perform (const Handle(TDocStd_Document) &doc,
-                                                const TCollection_AsciiString &filename)
+Standard_Boolean STEPCAFControl_Writer::Perform(const Handle(TDocStd_Document) &doc,
+  const TCollection_AsciiString &filename)
 {
-  if ( ! Transfer ( doc ) ) return Standard_False;
-  return Write ( filename.ToCString() ) == IFSelect_RetDone;
+  if (!Transfer(doc)) return Standard_False;
+  return Write(filename.ToCString()) == IFSelect_RetDone;
 }
 
 
@@ -449,7 +449,7 @@ Standard_Boolean STEPCAFControl_Writer::Perform (const Handle(TDocStd_Document)
 //purpose  :
 //=======================================================================
 
-const NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)>& STEPCAFControl_Writer::ExternFiles () const
+const NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)>& STEPCAFControl_Writer::ExternFiles() const
 {
   return myFiles;
 }
@@ -460,12 +460,12 @@ const NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternF
 //purpose  :
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::ExternFile (const TDF_Label &L,
-                                                   Handle(STEPCAFControl_ExternFile) &ef) const
+Standard_Boolean STEPCAFControl_Writer::ExternFile(const TDF_Label &L,
+  Handle(STEPCAFControl_ExternFile) &ef) const
 {
   ef.Nullify();
-  if ( ! myLabEF.IsBound ( L ) ) return Standard_False;
-  ef = myLabEF.Find ( L );
+  if (!myLabEF.IsBound(L)) return Standard_False;
+  ef = myLabEF.Find(L);
   return Standard_True;
 }
 
@@ -475,13 +475,13 @@ Standard_Boolean STEPCAFControl_Writer::ExternFile (const TDF_Label &L,
 //purpose  :
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::ExternFile (const Standard_CString name,
-                                                   Handle(STEPCAFControl_ExternFile) &ef) const
+Standard_Boolean STEPCAFControl_Writer::ExternFile(const Standard_CString name,
+  Handle(STEPCAFControl_ExternFile) &ef) const
 {
   ef.Nullify();
-  if ( ! myFiles.IsEmpty() || ! myFiles.IsBound ( name ) )
+  if (!myFiles.IsEmpty() || !myFiles.IsBound(name))
     return Standard_False;
-  ef = myFiles.Find( name );
+  ef = myFiles.Find(name);
   return Standard_True;
 }
 
@@ -491,7 +491,7 @@ Standard_Boolean STEPCAFControl_Writer::ExternFile (const Standard_CString name,
 //purpose  :
 //=======================================================================
 
-STEPControl_Writer &STEPCAFControl_Writer::ChangeWriter ()
+STEPControl_Writer &STEPCAFControl_Writer::ChangeWriter()
 {
   return myWriter;
 }
@@ -502,7 +502,7 @@ STEPControl_Writer &STEPCAFControl_Writer::ChangeWriter ()
 //purpose  :
 //=======================================================================
 
-const STEPControl_Writer &STEPCAFControl_Writer::Writer () const
+const STEPControl_Writer &STEPCAFControl_Writer::Writer() const
 {
   return myWriter;
 }
@@ -513,32 +513,39 @@ const STEPControl_Writer &STEPCAFControl_Writer::Writer () const
 //purpose  :
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::Transfer (STEPControl_Writer &writer,
-                                                 const TDF_LabelSequence &labels,
-                                                 const STEPControl_StepModelType mode,
-                                                 const Standard_CString multi,
-                                                  const Standard_Boolean isExternFile)
+Standard_Boolean STEPCAFControl_Writer::Transfer(STEPControl_Writer &writer,
+  const TDF_LabelSequence &labels,
+  const STEPControl_StepModelType mode,
+  const Standard_CString multi,
+  const Standard_Boolean isExternFile)
 {
-  if ( labels.Length() <=0 ) return Standard_False;
+  if (labels.Length() <= 0) return Standard_False;
 
   Handle(STEPCAFControl_ActorWrite) Actor =
-    Handle(STEPCAFControl_ActorWrite)::DownCast (writer.WS()->NormAdaptor()->ActorWrite());
-
+    Handle(STEPCAFControl_ActorWrite)::DownCast(writer.WS()->NormAdaptor()->ActorWrite());
+  
   // translate free top-level shapes of the DECAF document
+
+
   Handle(StepData_StepModel) aModel = writer.Model();
-  Standard_Integer ap = aModel->GetParam("write.step.schema")->IntegerValue();
+
+  if (Actor.IsNull())
+  {
+    return Standard_False;
+  }
+  Standard_Integer ap = aModel->IVal("write.step.schema");
   TDF_LabelSequence sublabels;
-  for ( Standard_Integer i=1; i <= labels.Length(); i++ ) {
+  for (Standard_Integer i = 1; i <= labels.Length(); i++) {
     TDF_Label L = labels.Value(i);
     TopoDS_Shape dummy;
-    if ( myLabels.IsBound ( L ) ) continue; // already processed
+    if (myLabels.IsBound(L)) continue; // already processed
+
+    TopoDS_Shape shape = XCAFDoc_ShapeTool::GetShape(L);
+    if (shape.IsNull()) continue;
 
-    TopoDS_Shape shape = XCAFDoc_ShapeTool::GetShape ( L );
-    if ( shape.IsNull() ) continue;
-    
     // write shape either as a whole, or as multifile (with extern refs)
-    if ( ! multi  ) {
-      Actor->SetStdMode ( Standard_False );
+    if (!multi) {
+      Actor->SetStdMode(Standard_False);
 
       TDF_LabelSequence comp;
 
@@ -549,19 +556,19 @@ Standard_Boolean STEPCAFControl_Writer::Transfer (STEPControl_Writer &writer,
       //as assembly with one component specified by current label. 
       //For that compound containing only specified component is binded to the label of the high-level assembly.
       //The such way full structure of high-level assembly was replaced on the assembly contaning one component.
-      if ( XCAFDoc_ShapeTool::IsComponent ( L ) )
+      if (XCAFDoc_ShapeTool::IsComponent(L))
       {
         TopoDS_Compound aComp;
         BRep_Builder aB;
         aB.MakeCompound(aComp);
         aB.Add(aComp, shape);
-        shape = aComp; 
+        shape = aComp;
         comp.Append(L);
         TDF_Label ref;
-        if ( XCAFDoc_ShapeTool::GetReferredShape ( L, ref ) )
+        if (XCAFDoc_ShapeTool::GetReferredShape(L, ref))
         {
-          if(XCAFDoc_ShapeTool::IsAssembly ( ref))
-            XCAFDoc_ShapeTool::GetComponents ( ref, comp, Standard_True );
+          if (XCAFDoc_ShapeTool::IsAssembly(ref))
+            XCAFDoc_ShapeTool::GetComponents(ref, comp, Standard_True);
         }
         L = L.Father();
       }
@@ -569,28 +576,28 @@ Standard_Boolean STEPCAFControl_Writer::Transfer (STEPControl_Writer &writer,
       {
         // fill sequence of (sub) shapes for which attributes should be written
         // and set actor to handle assemblies in a proper way
-        if(XCAFDoc_ShapeTool::IsAssembly ( L ))
-          XCAFDoc_ShapeTool::GetComponents ( L, comp, Standard_True );
+        if (XCAFDoc_ShapeTool::IsAssembly(L))
+          XCAFDoc_ShapeTool::GetComponents(L, comp, Standard_True);
       }
-      
-      for ( Standard_Integer k=1; k <= comp.Length(); k++ ) {
+
+      for (Standard_Integer k = 1; k <= comp.Length(); k++) {
         TDF_Label ref;
-        if ( ! XCAFDoc_ShapeTool::GetReferredShape ( comp(k), ref ) ) continue;
-        if ( ! myLabels.IsBound ( ref ) ) {
-          TopoDS_Shape refS = XCAFDoc_ShapeTool::GetShape ( ref );
-          myLabels.Bind ( ref, refS );
-          sublabels.Append ( ref );
-          if ( XCAFDoc_ShapeTool::IsAssembly ( ref ) )
-            Actor->RegisterAssembly ( refS );
+        if (!XCAFDoc_ShapeTool::GetReferredShape(comp(k), ref)) continue;
+        if (!myLabels.IsBound(ref)) {
+          TopoDS_Shape refS = XCAFDoc_ShapeTool::GetShape(ref);
+          myLabels.Bind(ref, refS);
+          sublabels.Append(ref);
+          if (XCAFDoc_ShapeTool::IsAssembly(ref))
+            Actor->RegisterAssembly(refS);
         }
       }
-      myLabels.Bind ( L, shape );
-      sublabels.Append ( L );
-      if ( XCAFDoc_ShapeTool::IsAssembly ( L ) )
-        Actor->RegisterAssembly ( shape );
+      myLabels.Bind(L, shape);
+      sublabels.Append(L);
+      if (XCAFDoc_ShapeTool::IsAssembly(L))
+        Actor->RegisterAssembly(shape);
 
-      writer.Transfer(shape,mode,Standard_False);
-      Actor->SetStdMode ( Standard_True ); // restore default behaviour
+      writer.Transfer(shape, mode, Standard_False);
+      Actor->SetStdMode(Standard_True); // restore default behaviour
     }
     else {
       // translate final solids
@@ -615,37 +622,47 @@ Standard_Boolean STEPCAFControl_Writer::Transfer (STEPControl_Writer &writer,
       }
 */
       Handle(Interface_Static) aParameter = aModel->GetParam("write.step.assembly");
-      Standard_Integer assemblymode = aParameter->IntegerValue();
-      aParameter->SetCStringValue("On");
+      Standard_Integer assemblymode = 0;
+      if (!aParameter.IsNull())
+      {
+        assemblymode = aParameter->IntegerValue();
+        aParameter->SetCStringValue("On");
+      }
       writer.Transfer(Sass, STEPControl_AsIs);
-      aParameter->SetIntegerValue(assemblymode);
-      aModel->GetParam("write.step.schema")->SetIntegerValue(ap);
+      if (!aParameter.IsNull())
+        aParameter->SetIntegerValue(assemblymode);
+      Handle(Interface_Static) aParamWriteSch = aModel->GetParam("write.step.schema");
+      if (!aParamWriteSch.IsNull())
+        aParamWriteSch->SetIntegerValue(ap);
+
+
+
     }
   }
 
-  writer.WS()->ComputeGraph(Standard_True );// added by skl 03.11.2003 since we use
+  writer.WS()->ComputeGraph(Standard_True);// added by skl 03.11.2003 since we use
                                             // writer.Transfer() wihtout compute graph
 
   // write names
-  if ( GetNameMode() )
-    WriteNames ( writer.WS(), sublabels );
+  if (GetNameMode())
+    WriteNames(writer.WS(), sublabels);
 
-  if ( !multi ) {
+  if (!multi) {
     // write colors
-    if ( GetColorMode() )
-      WriteColors ( writer.WS(), sublabels );
-    
+    if (GetColorMode())
+      WriteColors(writer.WS(), sublabels);
+
     // write layers
-    if ( GetLayerMode() )
-      WriteLayers ( writer.WS(), sublabels );
+    if (GetLayerMode())
+      WriteLayers(writer.WS(), sublabels);
 
     // write SHUO entities
-    if ( GetSHUOMode() && !isExternFile ) 
+    if (GetSHUOMode() && !isExternFile)
       // do not store SHUO for extern reference for the moment
-      WriteSHUOs (  writer.WS(), sublabels );
-    
+      WriteSHUOs(writer.WS(), sublabels);
+
     // write G&DTs
-    if(GetDimTolMode()) {
+    if (GetDimTolMode()) {
       if (ap == 5) {
         WriteDGTsAP242(writer.WS(), sublabels);
       }
@@ -655,63 +672,65 @@ Standard_Boolean STEPCAFControl_Writer::Transfer (STEPControl_Writer &writer,
     }
 
     // write Materials
-    if(GetMaterialMode())
-      WriteMaterials(writer.WS(),sublabels);
+    if (GetMaterialMode())
+      WriteMaterials(writer.WS(), sublabels);
 
     // register all MDGPRs in model
     const Handle(Interface_InterfaceModel) &Model = writer.WS()->Model();
     MoniTool_DataMapIteratorOfDataMapOfShapeTransient anItr(myMapCompMDGPR);
     for (; anItr.More(); anItr.Next())
-      Model->AddWithRefs( anItr.Value() );
+      Model->AddWithRefs(anItr.Value());
   }
-  
-  if ( multi ) { // external refs
-    WriteExternRefs ( writer.WS(), sublabels );
+
+  if (multi) { // external refs
+    WriteExternRefs(writer.WS(), sublabels);
   }
 
   // write validation props
 //  if ( multi && ap ==3 ) {
 //       myCAFController->GetParam("write.step.schema")->SetCStringValue("AP214DIS");
 //  }
-  if ( GetPropsMode() ) 
-    WriteValProps ( writer.WS(), sublabels, multi );
+  if (GetPropsMode())
+    WriteValProps(writer.WS(), sublabels, multi);
 
-  aModel->GetParam("write.step.schema")->SetIntegerValue(ap);
+  Handle(Interface_Static) aParam = aModel->GetParam("write.step.schema");
+  if (!aParam.IsNull())
+    aParam->SetIntegerValue(ap);
 
   // refresh graph
-  writer.WS()->ComputeGraph ( Standard_True );
+  writer.WS()->ComputeGraph(Standard_True);
 
   /* ================================
     *  Write names for the sub-shapes
     * ================================ */
 
-  if (aModel->GetParam("write.stepcaf.subshapes.name")->IntegerValue() != 0)
+  if (aModel->IVal("write.stepcaf.subshapes.name") != 0)
   {
     const Handle(XSControl_TransferWriter) &TW = this->ChangeWriter().WS()->TransferWriter();
     const Handle(Transfer_FinderProcess) &FP = TW->FinderProcess();
 
-    for ( int i = 1; i <= labels.Length(); i++ )
+    for (int i = 1; i <= labels.Length(); i++)
     {
       TDF_Label L = labels.Value(i);
 
-      for ( TDF_ChildIterator it(L, Standard_True); it.More(); it.Next() )
+      for (TDF_ChildIterator it(L, Standard_True); it.More(); it.Next())
       {
         TDF_Label SubL = it.Value();
 
         // Access name recorded in OCAF TDataStd_Name attribute
         Handle(TCollection_HAsciiString) hSubName = new TCollection_HAsciiString;
-        if ( !GetLabelName(SubL, hSubName) )
+        if (!GetLabelName(SubL, hSubName))
           continue;
 
         // Access topological data
         TopoDS_Shape SubS = XCAFDoc_ShapeTool::GetShape(SubL);
-        if ( SubS.IsNull() )
+        if (SubS.IsNull())
           continue;
 
         // Access the correspondent STEP Representation Item
         Handle(StepRepr_RepresentationItem) RI;
         Handle(TransferBRep_ShapeMapper) aShMapper = TransferBRep::ShapeMapper(FP, SubS);
-        if ( !FP->FindTypedTransient(aShMapper, STANDARD_TYPE(StepRepr_RepresentationItem), RI) )
+        if (!FP->FindTypedTransient(aShMapper, STANDARD_TYPE(StepRepr_RepresentationItem), RI))
           continue;
 
         // Record the name
@@ -729,88 +748,93 @@ Standard_Boolean STEPCAFControl_Writer::Transfer (STEPControl_Writer &writer,
 //purpose  :
 //=======================================================================
 
-TopoDS_Shape STEPCAFControl_Writer::TransferExternFiles (const TDF_Label &L,
-                                                        const STEPControl_StepModelType mode,
-                                                        TDF_LabelSequence &labels,
-                                                        const Standard_CString prefix)
+TopoDS_Shape STEPCAFControl_Writer::TransferExternFiles(const TDF_Label &L,
+  const STEPControl_StepModelType mode,
+  TDF_LabelSequence &labels,
+  const Standard_CString prefix)
 {
   // if label already translated, just return the shape
-  if ( myLabels.IsBound ( L ) ) {
-    return myLabels.Find ( L );
+  if (myLabels.IsBound(L)) {
+    return myLabels.Find(L);
   }
 
   TopoDS_Compound C;
   BRep_Builder B;
-  B.MakeCompound ( C );
+  B.MakeCompound(C);
   //labels.Append ( L ); 
   // if not assembly, write to separate file
-  if ( ! XCAFDoc_ShapeTool::IsAssembly ( L ) && !XCAFDoc_ShapeTool::IsComponent ( L )) {
-    labels.Append ( L );
+  if (!XCAFDoc_ShapeTool::IsAssembly(L) && !XCAFDoc_ShapeTool::IsComponent(L)) {
+    labels.Append(L);
     // prepare for transfer
     Handle(XSControl_WorkSession) newWS = new XSControl_WorkSession;
-    newWS->SelectNorm ( "STEP" );
-    STEPControl_Writer sw ( newWS, Standard_True );
+    newWS->SelectNorm("STEP");
+    STEPControl_Writer sw(newWS, Standard_True);
     TDF_LabelSequence Lseq;
-    Lseq.Append ( L );
+    Lseq.Append(L);
 
     // construct the name for extern file
     Handle(TCollection_HAsciiString) basename = new TCollection_HAsciiString;
-    if ( prefix && prefix[0] ) basename->AssignCat ( prefix );
-    GetLabelName ( L, basename );
-    Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString ( basename );
-    name->AssignCat ( ".stp" );
-    if ( myFiles.IsBound( name->ToCString() ) ) { // avoid confusions
-      for ( Standard_Integer k=1; k < 32000; k++ ) {
-        name = new TCollection_HAsciiString ( basename );
-        name->AssignCat ( "_" );
-        name->AssignCat ( TCollection_AsciiString ( k ).ToCString() );
-        name->AssignCat ( ".stp" );
-        if ( ! myFiles.IsBound ( name->ToCString() ) ) break;
+    if (prefix && prefix[0]) basename->AssignCat(prefix);
+    GetLabelName(L, basename);
+    Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString(basename);
+    name->AssignCat(".stp");
+    if (myFiles.IsBound(name->ToCString())) { // avoid confusions
+      for (Standard_Integer k = 1; k < 32000; k++) {
+        name = new TCollection_HAsciiString(basename);
+        name->AssignCat("_");
+        name->AssignCat(TCollection_AsciiString(k).ToCString());
+        name->AssignCat(".stp");
+        if (!myFiles.IsBound(name->ToCString())) break;
       }
     }
 
     // translate and record extern file
     Handle(STEPCAFControl_ExternFile) EF = new STEPCAFControl_ExternFile;
-    EF->SetWS ( newWS );
-    EF->SetName ( name );
-    EF->SetLabel ( L );
+    EF->SetWS(newWS);
+    EF->SetName(name);
+    EF->SetLabel(L);
     Handle(Interface_Static) aParameter = sw.Model()->GetParam("write.step.assembly");
-    Standard_Integer assemblymode = aParameter->IntegerValue();
-    aParameter->SetCStringValue("Off");
+    Standard_Integer assemblymode = 0;
+    if (!aParameter.IsNull())
+    {
+      assemblymode = aParameter->IntegerValue();
+      aParameter->SetCStringValue("Off");
+    }
     const Standard_CString multi = 0;
-    EF->SetTransferStatus ( Transfer ( sw, Lseq, mode, multi, Standard_True ) );
-    aParameter->SetIntegerValue(assemblymode);
-    myLabEF.Bind ( L, EF );
-    myFiles.Bind ( name->ToCString(), EF );
+    EF->SetTransferStatus(Transfer(sw, Lseq, mode, multi, Standard_True));
+    if (!aParameter.IsNull())
+      aParameter->SetIntegerValue(assemblymode);
+    myLabEF.Bind(L, EF);
+    myFiles.Bind(name->ToCString(), EF);
 
     // return empty compound as replacement for the shape
-    myLabels.Bind ( L, C );
+    myLabels.Bind(L, C);
     return C;
   }
   TDF_LabelSequence comp;
   TDF_Label aCurL = L;
   //if specified shape is component then high-level assembly is considered
   //to get valid structure with location
-  if ( XCAFDoc_ShapeTool::IsComponent ( L ) )
+  if (XCAFDoc_ShapeTool::IsComponent(L))
   {
     comp.Append(L);
     aCurL = L.Father();
   }
   // else iterate on components add create structure of empty compounds
   // representing the assembly
-  else if (XCAFDoc_ShapeTool::IsAssembly ( L ))
-    XCAFDoc_ShapeTool::GetComponents ( L, comp, Standard_False );
+  else if (XCAFDoc_ShapeTool::IsAssembly(L))
+    XCAFDoc_ShapeTool::GetComponents(L, comp, Standard_False);
 
-  labels.Append ( aCurL );
-  for ( Standard_Integer k=1; k <= comp.Length(); k++ ) {
+  labels.Append(aCurL);
+  for (Standard_Integer k = 1; k <= comp.Length(); k++) {
     TDF_Label lab = comp(k);
     TDF_Label ref;
-    if ( ! XCAFDoc_ShapeTool::GetReferredShape ( lab, ref ) ) continue;
-    TopoDS_Shape Scomp = TransferExternFiles ( ref, mode, labels, prefix );
-    Scomp.Location ( XCAFDoc_ShapeTool::GetLocation ( lab ) );
-    B.Add ( C, Scomp );
+    if (!XCAFDoc_ShapeTool::GetReferredShape(lab, ref)) continue;
+    TopoDS_Shape Scomp = TransferExternFiles(ref, mode, labels, prefix);
+    Scomp.Location(XCAFDoc_ShapeTool::GetLocation(lab));
+    B.Add(C, Scomp);
   }
-  myLabels.Bind ( aCurL, C );
+  myLabels.Bind(aCurL, C);
   return C;
 }
 
@@ -820,38 +844,38 @@ TopoDS_Shape STEPCAFControl_Writer::TransferExternFiles (const TDF_Label &L,
 //purpose  :
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::WriteExternRefs (const Handle(XSControl_WorkSession) &WS,
-                                                        const TDF_LabelSequence &labels) const
+Standard_Boolean STEPCAFControl_Writer::WriteExternRefs(const Handle(XSControl_WorkSession) &WS,
+  const TDF_LabelSequence &labels) const
 {
-  if ( labels.Length() <=0 ) return Standard_False;
+  if (labels.Length() <= 0) return Standard_False;
 
   const Handle(XSControl_TransferWriter) &TW = WS->TransferWriter();
   const Handle(Transfer_FinderProcess) &FP = TW->FinderProcess();
-  STEPConstruct_ExternRefs EFTool ( WS );
+  STEPConstruct_ExternRefs EFTool(WS);
   Standard_Integer schema = WS->Model()->GetParam("write.step.schema")->IntegerValue();
-  for ( Standard_Integer k=1; k <= labels.Length(); k++ ) {
+  for (Standard_Integer k = 1; k <= labels.Length(); k++) {
     TDF_Label lab = labels(k);
-    if ( XCAFDoc_ShapeTool::IsAssembly ( lab ) ) continue; // skip assemblies
+    if (XCAFDoc_ShapeTool::IsAssembly(lab)) continue; // skip assemblies
 
     // get extern file
     Handle(STEPCAFControl_ExternFile) EF;
-    if ( ! ExternFile ( lab, EF ) ) continue; // should never be
+    if (!ExternFile(lab, EF)) continue; // should never be
 
     // find SDR
-    if ( ! myLabels.IsBound ( lab ) ) continue; // not recorded as translated, skip
-    TopoDS_Shape S = myLabels.Find ( lab );
+    if (!myLabels.IsBound(lab)) continue; // not recorded as translated, skip
+    TopoDS_Shape S = myLabels.Find(lab);
 
     Handle(StepShape_ShapeDefinitionRepresentation) SDR;
-    Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FP, S );
-    if ( ! FP->FindTypedTransient ( mapper, STANDARD_TYPE(StepShape_ShapeDefinitionRepresentation), SDR ) ) {
+    Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper(FP, S);
+    if (!FP->FindTypedTransient(mapper, STANDARD_TYPE(StepShape_ShapeDefinitionRepresentation), SDR)) {
 #ifdef OCCT_DEBUG
       cout << "Warning: Cannot find SDR for " << S.TShape()->DynamicType()->Name() << endl;
 #endif
       continue;
-    }
+  }
 
     // add extern ref
-    const Standard_CString format = (const Standard_CString) ( schema == 3 ? "STEP AP203" : "STEP AP214" );
+    const Standard_CString format = (const Standard_CString)(schema == 3 ? "STEP AP203" : "STEP AP214");
     // try to get PD from SDR
     StepRepr_RepresentedDefinition RD = SDR->Definition();
     Handle(StepRepr_PropertyDefinition) aPropDef = RD.PropertyDefinition();
@@ -860,7 +884,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteExternRefs (const Handle(XSControl_
       cout << "Warning: STEPCAFControl_Writer::WriteExternRefs StepRepr_PropertyDefinition is null for " << S.TShape()->DynamicType()->Name() << endl;
 #endif
       continue;
-    }
+}
     StepRepr_CharacterizedDefinition CharDef = aPropDef->Definition();
     Handle(StepBasic_ProductDefinition) PD = CharDef.ProductDefinition();
     if (PD.IsNull()) {
@@ -869,7 +893,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteExternRefs (const Handle(XSControl_
 #endif
       continue;
     }
-    EFTool.AddExternRef ( EF->GetName()->ToCString(), PD, format );
+    EFTool.AddExternRef(EF->GetName()->ToCString(), PD, format);
   }
   EFTool.WriteExternRefs(schema);
   return Standard_True;
@@ -880,59 +904,59 @@ Standard_Boolean STEPCAFControl_Writer::WriteExternRefs (const Handle(XSControl_
 //function : FindEntities
 //purpose  : auxilary
 //=======================================================================
-static Standard_Integer FindEntities (const Handle(Transfer_FinderProcess) &FP,
-                                     const TopoDS_Shape &S,
-                                     TopLoc_Location &L,
-                                     TColStd_SequenceOfTransient &seqRI)
+static Standard_Integer FindEntities(const Handle(Transfer_FinderProcess) &FP,
+  const TopoDS_Shape &S,
+  TopLoc_Location &L,
+  TColStd_SequenceOfTransient &seqRI)
 {
-  Handle(StepRepr_RepresentationItem) item = STEPConstruct::FindEntity ( FP, S, L );
+  Handle(StepRepr_RepresentationItem) item = STEPConstruct::FindEntity(FP, S, L);
 
-  if ( ! item.IsNull() ) {
-    seqRI.Append ( item );
+  if (!item.IsNull()) {
+    seqRI.Append(item);
     return 1;
   }
-      
+
   // may be S was splited during shape processing
-  Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FP, S );
-  Handle(Transfer_Binder) bnd = FP->Find ( mapper );
-  if ( bnd.IsNull() ) return 0;
-  
+  Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper(FP, S);
+  Handle(Transfer_Binder) bnd = FP->Find(mapper);
+  if (bnd.IsNull()) return 0;
+
   Handle(Transfer_TransientListBinder) TransientListBinder =
     //Handle(Transfer_TransientListBinder)::DownCast( bnd->Next(Standard_True) );
-    Handle(Transfer_TransientListBinder)::DownCast( bnd );
-  Standard_Integer nres=0;
-  if ( TransientListBinder.IsNull() && S.ShapeType() == TopAbs_COMPOUND) 
+    Handle(Transfer_TransientListBinder)::DownCast(bnd);
+  Standard_Integer nres = 0;
+  if (TransientListBinder.IsNull() && S.ShapeType() == TopAbs_COMPOUND)
   {
-    for ( TopoDS_Iterator it(S); it.More(); it.Next() ) {
-      Handle(StepRepr_RepresentationItem) aLocalItem = STEPConstruct::FindEntity ( FP, it.Value(), L );
-      if (aLocalItem.IsNull() ) continue;
+    for (TopoDS_Iterator it(S); it.More(); it.Next()) {
+      Handle(StepRepr_RepresentationItem) aLocalItem = STEPConstruct::FindEntity(FP, it.Value(), L);
+      if (aLocalItem.IsNull()) continue;
       nres++;
-      seqRI.Append (aLocalItem);
+      seqRI.Append(aLocalItem);
     }
   }
-  else if(!TransientListBinder.IsNull())
+  else if (!TransientListBinder.IsNull())
   {
 
     const Standard_Integer nb = TransientListBinder->NbTransients();
-    for (Standard_Integer i=1; i<=nb; i++) {
+    for (Standard_Integer i = 1; i <= nb; i++) {
       Handle(Standard_Transient) t = TransientListBinder->Transient(i);
       item = Handle(StepRepr_RepresentationItem)::DownCast(t);
-      if ( item.IsNull() ) continue;
+      if (item.IsNull()) continue;
       nres++;
-      seqRI.Append ( item );
+      seqRI.Append(item);
     }
   }
-/*  works but is obsolete: another approach
-  if (i<=nb) {
-    TopoDS_Shape comp = TransferBRep::ShapeResult(bnd);
-    if ( ! comp.IsNull() && comp.ShapeType() < S.ShapeType() ) {
-      for ( TopoDS_Iterator it(comp); it.More(); it.Next() ) {
-        MakeSTEPStyles(Styles, it.Value(), settings, STEPstyle, 
-                      Map, ( hasOwn ? &style : 0 ) );
+  /*  works but is obsolete: another approach
+    if (i<=nb) {
+      TopoDS_Shape comp = TransferBRep::ShapeResult(bnd);
+      if ( ! comp.IsNull() && comp.ShapeType() < S.ShapeType() ) {
+        for ( TopoDS_Iterator it(comp); it.More(); it.Next() ) {
+          MakeSTEPStyles(Styles, it.Value(), settings, STEPstyle,
+             Map, ( hasOwn ? &style : 0 ) );
+        }
       }
     }
-  }
-*/
+  */
   return nres;
 }
 
@@ -942,39 +966,39 @@ static Standard_Integer FindEntities (const Handle(Transfer_FinderProcess) &FP,
 //purpose  : auxilary
 //=======================================================================
 static Standard_Boolean getStyledItem(const TopoDS_Shape& S,
-                                      const Handle(XCAFDoc_ShapeTool)& STool,
-                                      const STEPConstruct_Styles &Styles, 
-                                      Handle(StepVisual_StyledItem) &resSelItem,
-                                      const MoniTool_DataMapOfShapeTransient& myMapCompMDGPR)
+  const Handle(XCAFDoc_ShapeTool)& STool,
+  const STEPConstruct_Styles &Styles,
+  Handle(StepVisual_StyledItem) &resSelItem,
+  const MoniTool_DataMapOfShapeTransient& myMapCompMDGPR)
 {
   TDF_Label aTopShL = STool->FindShape(S, Standard_False);
-  TopoDS_Shape aTopLevSh = STool->GetShape( aTopShL );
+  TopoDS_Shape aTopLevSh = STool->GetShape(aTopShL);
   Standard_Boolean found = Standard_False;
-  if ( !aTopLevSh.IsNull() &&  myMapCompMDGPR.IsBound( aTopLevSh ) ) {
-    Handle(StepVisual_PresentationRepresentation) aMDGPR = 
-      Handle(StepVisual_PresentationRepresentation)::DownCast( myMapCompMDGPR.Find( aTopLevSh ) );
+  if (!aTopLevSh.IsNull() && myMapCompMDGPR.IsBound(aTopLevSh)) {
+    Handle(StepVisual_PresentationRepresentation) aMDGPR =
+      Handle(StepVisual_PresentationRepresentation)::DownCast(myMapCompMDGPR.Find(aTopLevSh));
     Handle(StepRepr_HArray1OfRepresentationItem) anSelItmHArr = aMDGPR->Items();
     // search for PSA of Monifold solid
-    if ( !anSelItmHArr.IsNull() )
+    if (!anSelItmHArr.IsNull())
     {
       for (Standard_Integer si = 1; si <= anSelItmHArr->Length(); si++) {
         Handle(StepVisual_StyledItem) aSelItm =
           Handle(StepVisual_StyledItem)::DownCast(anSelItmHArr->Value(si));
 
-        if ( aSelItm.IsNull() ) 
+        if (aSelItm.IsNull())
           continue;
 
         // check that it is a stiled item for monifold solid brep
         TopLoc_Location Loc;
         TColStd_SequenceOfTransient aNewseqRI;
-        FindEntities ( Styles.FinderProcess(), aTopLevSh, Loc, aNewseqRI );
-        if ( aNewseqRI.Length() > 0 )
+        FindEntities(Styles.FinderProcess(), aTopLevSh, Loc, aNewseqRI);
+        if (aNewseqRI.Length() > 0)
         {
-          
+
           Handle(StepRepr_RepresentationItem) anItem = aSelItm->Item();
           Standard_Boolean isSameMonSolBR = Standard_False;
           for (Standard_Integer mi = 1; mi <= aNewseqRI.Length(); mi++) {
-            if ( !anItem.IsNull() && anItem == aNewseqRI.Value( mi ) ) {
+            if (!anItem.IsNull() && anItem == aNewseqRI.Value(mi)) {
               isSameMonSolBR = Standard_True;
               break;
             }
@@ -982,8 +1006,8 @@ static Standard_Boolean getStyledItem(const TopoDS_Shape& S,
           if (!isSameMonSolBR)
             continue;
         }
-        
-        
+
+
         for (Standard_Integer jsi = 1; jsi <= aSelItm->NbStyles() && !found; jsi++) {
           Handle(StepVisual_PresentationStyleAssignment) aFatherPSA = aSelItm->StylesValue(jsi);
           // check for PSA for top-level (not Presentation style by contex for NAUO)
@@ -1003,43 +1027,43 @@ static Standard_Boolean getStyledItem(const TopoDS_Shape& S,
 //function : setDefaultInstanceColor
 //purpose  : auxilary
 //=======================================================================
-static Standard_Boolean setDefaultInstanceColor (const Handle(StepVisual_StyledItem) &aSelItm,
-                                                 Handle(StepVisual_PresentationStyleAssignment)& PSA)
+static Standard_Boolean setDefaultInstanceColor(const Handle(StepVisual_StyledItem) &aSelItm,
+  Handle(StepVisual_PresentationStyleAssignment)& PSA)
 {
-   Standard_Boolean found = Standard_False;
+  Standard_Boolean found = Standard_False;
   for (Standard_Integer jsi = 1; jsi <= aSelItm->NbStyles() && !found; jsi++) {
     Handle(StepVisual_PresentationStyleAssignment) aFatherPSA = aSelItm->StylesValue(jsi);
-  // check for PSA for top-level (not Presentation style by contex for NAUO)
-  if (aFatherPSA.IsNull() || aFatherPSA->IsKind(STANDARD_TYPE(StepVisual_PresentationStyleByContext))) 
-    return Standard_False;
-          
-  // get style select from father PSA
-  if (aFatherPSA->NbStyles() > 0) {
-    Handle(StepVisual_HArray1OfPresentationStyleSelect) aFatherStyles =
-      new StepVisual_HArray1OfPresentationStyleSelect(1, aFatherPSA->NbStyles());
-    for (Standard_Integer k = 1; k <= aFatherPSA->NbStyles(); k++) {
-      StepVisual_PresentationStyleSelect PSS;
-      StepVisual_PresentationStyleSelect olDPSS = aFatherPSA->StylesValue(k);
-      if (!olDPSS.PointStyle().IsNull())
-        PSS.SetValue (olDPSS.PointStyle());
-      else if (!olDPSS.CurveStyle().IsNull())
-        PSS.SetValue (olDPSS.CurveStyle());
-      else if (!olDPSS.SurfaceStyleUsage().IsNull())
-        PSS.SetValue (olDPSS.SurfaceStyleUsage());
-      else {
-        found = Standard_False;
-        break;
+    // check for PSA for top-level (not Presentation style by contex for NAUO)
+    if (aFatherPSA.IsNull() || aFatherPSA->IsKind(STANDARD_TYPE(StepVisual_PresentationStyleByContext)))
+      return Standard_False;
+
+    // get style select from father PSA
+    if (aFatherPSA->NbStyles() > 0) {
+      Handle(StepVisual_HArray1OfPresentationStyleSelect) aFatherStyles =
+        new StepVisual_HArray1OfPresentationStyleSelect(1, aFatherPSA->NbStyles());
+      for (Standard_Integer k = 1; k <= aFatherPSA->NbStyles(); k++) {
+        StepVisual_PresentationStyleSelect PSS;
+        StepVisual_PresentationStyleSelect olDPSS = aFatherPSA->StylesValue(k);
+        if (!olDPSS.PointStyle().IsNull())
+          PSS.SetValue(olDPSS.PointStyle());
+        else if (!olDPSS.CurveStyle().IsNull())
+          PSS.SetValue(olDPSS.CurveStyle());
+        else if (!olDPSS.SurfaceStyleUsage().IsNull())
+          PSS.SetValue(olDPSS.SurfaceStyleUsage());
+        else {
+          found = Standard_False;
+          break;
+        }
+        //aFatherStyles->SetValue( k, PSS );
+        aFatherStyles->SetValue(k, olDPSS);
+        found = Standard_True;
+      }
+      // init PSA of NAUO
+      if (found) {
+        PSA->Init(aFatherStyles);
       }
-      //aFatherStyles->SetValue( k, PSS );
-      aFatherStyles->SetValue( k, olDPSS );
-      found = Standard_True;
-    }
-            // init PSA of NAUO
-    if (found) {
-      PSA->Init( aFatherStyles );
     }
-  }
-    
+
   }
   return found;
 }
@@ -1049,86 +1073,86 @@ static Standard_Boolean setDefaultInstanceColor (const Handle(StepVisual_StyledI
 //function : MakeSTEPStyles
 //purpose  : auxilary
 //=======================================================================
-static void MakeSTEPStyles (STEPConstruct_Styles &Styles,
-                           const TopoDS_Shape &S,
-                           const XCAFPrs_DataMapOfShapeStyle &settings,
-                           Handle(StepVisual_StyledItem) &override,
-                           TopTools_MapOfShape &Map,
-                            const MoniTool_DataMapOfShapeTransient& myMapCompMDGPR,
-                            STEPConstruct_DataMapOfAsciiStringTransient &DPDCs,
-                            STEPConstruct_DataMapOfPointTransient &ColRGBs,
-                            const Handle(XCAFDoc_ColorTool)& CTool,
-                           const XCAFPrs_Style *inherit = 0,
-                            const Standard_Boolean isComponent = Standard_False)
+static void MakeSTEPStyles(STEPConstruct_Styles &Styles,
+  const TopoDS_Shape &S,
+  const XCAFPrs_DataMapOfShapeStyle &settings,
+  Handle(StepVisual_StyledItem) &override,
+  TopTools_MapOfShape &Map,
+  const MoniTool_DataMapOfShapeTransient& myMapCompMDGPR,
+  STEPConstruct_DataMapOfAsciiStringTransient &DPDCs,
+  STEPConstruct_DataMapOfPointTransient &ColRGBs,
+  const Handle(XCAFDoc_ColorTool)& CTool,
+  const XCAFPrs_Style *inherit = 0,
+  const Standard_Boolean isComponent = Standard_False)
 {
   // skip already processed shapes
-  if ( ! Map.Add ( S ) ) return;
+  if (!Map.Add(S)) return;
 
   // check if shape has its own style (r inherits from ancestor)
   XCAFPrs_Style style;
-  if ( inherit ) style = *inherit;
-  if ( settings.IsBound(S) ) {
+  if (inherit) style = *inherit;
+  if (settings.IsBound(S)) {
     XCAFPrs_Style own = settings.Find(S);
-    if ( !own.IsVisible() ) style.SetVisibility ( Standard_False );
-    if ( own.IsSetColorCurv() ) style.SetColorCurv ( own.GetColorCurv() );
-    if ( own.IsSetColorSurf() ) style.SetColorSurf ( own.GetColorSurf() );
+    if (!own.IsVisible()) style.SetVisibility(Standard_False);
+    if (own.IsSetColorCurv()) style.SetColorCurv(own.GetColorCurv());
+    if (own.IsSetColorSurf()) style.SetColorSurf(own.GetColorSurf());
   }
 
   // translate colors to STEP
   Handle(StepVisual_Colour) surfColor, curvColor;
-  if ( style.IsSetColorSurf() )
-    surfColor = Styles.EncodeColor(style.GetColorSurf(),DPDCs,ColRGBs);
-  if ( style.IsSetColorCurv() )
-    curvColor = Styles.EncodeColor(style.GetColorCurv(),DPDCs,ColRGBs);
-  
-  Standard_Boolean hasOwn = ( ! surfColor.IsNull() || 
-                              ! curvColor.IsNull() ||
-                              ! style.IsVisible() );
+  if (style.IsSetColorSurf())
+    surfColor = Styles.EncodeColor(style.GetColorSurf(), DPDCs, ColRGBs);
+  if (style.IsSetColorCurv())
+    curvColor = Styles.EncodeColor(style.GetColorCurv(), DPDCs, ColRGBs);
+
+  Standard_Boolean hasOwn = (!surfColor.IsNull() ||
+    !curvColor.IsNull() ||
+    !style.IsVisible());
 
   // find target item and assign style to it
   Handle(StepVisual_StyledItem) STEPstyle = override;
-  if ( hasOwn ) {
-    if ( S.ShapeType() != TopAbs_COMPOUND || isComponent ) { // skip compounds, let subshapes inherit its colors
+  if (hasOwn) {
+    if (S.ShapeType() != TopAbs_COMPOUND || isComponent) { // skip compounds, let subshapes inherit its colors
       TopLoc_Location L;
       TColStd_SequenceOfTransient seqRI;
-      Standard_Integer nb = FindEntities ( Styles.FinderProcess(), S, L, seqRI );
+      Standard_Integer nb = FindEntities(Styles.FinderProcess(), S, L, seqRI);
 #ifdef OCCT_DEBUG
-      if ( nb <=0 ) cout << "Warning: Cannot find RI for " << S.TShape()->DynamicType()->Name() << endl;
+      if (nb <= 0) cout << "Warning: Cannot find RI for " << S.TShape()->DynamicType()->Name() << endl;
 #endif
       //Get overridden style gka 10.06.03
-      if ( isComponent && nb) 
-        getStyledItem(S, CTool->ShapeTool(), Styles, override,myMapCompMDGPR);
-       
-           
-      for ( Standard_Integer i=1; i <= nb; i++ ) {
-        Handle(StepRepr_RepresentationItem) item = 
+      if (isComponent && nb)
+        getStyledItem(S, CTool->ShapeTool(), Styles, override, myMapCompMDGPR);
+
+
+      for (Standard_Integer i = 1; i <= nb; i++) {
+        Handle(StepRepr_RepresentationItem) item =
           Handle(StepRepr_RepresentationItem)::DownCast(seqRI(i));
         Handle(StepVisual_PresentationStyleAssignment) PSA;
-        if ( style.IsVisible() || !surfColor.IsNull() || !curvColor.IsNull() ) {
-          PSA = Styles.MakeColorPSA ( item, surfColor, curvColor, isComponent );
+        if (style.IsVisible() || !surfColor.IsNull() || !curvColor.IsNull()) {
+          PSA = Styles.MakeColorPSA(item, surfColor, curvColor, isComponent);
         }
         else {
           // default white color
-          surfColor = Styles.EncodeColor(Quantity_Color(1,1,1,Quantity_TOC_RGB),DPDCs,ColRGBs);
-          PSA = Styles.MakeColorPSA ( item, surfColor, curvColor, isComponent );
-          if ( isComponent ) 
-            setDefaultInstanceColor( override, PSA);
-          
+          surfColor = Styles.EncodeColor(Quantity_Color(1, 1, 1, Quantity_TOC_RGB), DPDCs, ColRGBs);
+          PSA = Styles.MakeColorPSA(item, surfColor, curvColor, isComponent);
+          if (isComponent)
+            setDefaultInstanceColor(override, PSA);
+
         } // end of component case
-        
-        STEPstyle = Styles.AddStyle ( item, PSA, override );
+
+        STEPstyle = Styles.AddStyle(item, PSA, override);
         hasOwn = Standard_False;
       }
     }
   }
 
   // iterate on subshapes (except vertices :)
-  if ( S.ShapeType() == TopAbs_EDGE ) return;
-  if ( !isComponent ) // PTV 10.02.2003
-    for ( TopoDS_Iterator it(S); it.More(); it.Next() ) {
-      MakeSTEPStyles ( Styles, it.Value(), settings, STEPstyle,
-                      Map, myMapCompMDGPR, DPDCs, ColRGBs, CTool,
-                      ( hasOwn ? &style : 0 ) );
+  if (S.ShapeType() == TopAbs_EDGE) return;
+  if (!isComponent) // PTV 10.02.2003
+    for (TopoDS_Iterator it(S); it.More(); it.Next()) {
+      MakeSTEPStyles(Styles, it.Value(), settings, STEPstyle,
+        Map, myMapCompMDGPR, DPDCs, ColRGBs, CTool,
+        (hasOwn ? &style : 0));
     }
 }
 
@@ -1156,7 +1180,7 @@ static Standard_Boolean getFatherColor (const TDF_Label& L,
     style.SetColorCurv ( C );
     done = Standard_True;
   }
-  
+
   return done;
 }
 */
@@ -1167,174 +1191,175 @@ static Standard_Boolean getFatherColor (const TDF_Label& L,
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::WriteColors (const Handle(XSControl_WorkSession) &WS,
-                                                    const TDF_LabelSequence &labels)
+Standard_Boolean STEPCAFControl_Writer::WriteColors(const Handle(XSControl_WorkSession) &WS,
+  const TDF_LabelSequence &labels)
 {
-  if ( labels.Length() <=0 ) return Standard_False;
+  if (labels.Length() <= 0) return Standard_False;
 
   // Iterate on shapes in the document
-  Handle(XCAFDoc_ColorTool) CTool = XCAFDoc_DocumentTool::ColorTool( labels(1) );
-  if ( CTool.IsNull() ) return Standard_False;
+  Handle(XCAFDoc_ColorTool) CTool = XCAFDoc_DocumentTool::ColorTool(labels(1));
+  if (CTool.IsNull()) return Standard_False;
 
-  STEPConstruct_Styles Styles ( WS );
+  STEPConstruct_Styles Styles(WS);
   STEPConstruct_DataMapOfAsciiStringTransient DPDCs;
   STEPConstruct_DataMapOfPointTransient ColRGBs;
-  for ( Standard_Integer i=1; i <= labels.Length(); i++ ) {
+  for (Standard_Integer i = 1; i <= labels.Length(); i++) {
     TDF_Label L = labels.Value(i);
 
-    Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool( labels(1) );
+    Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(labels(1));
     // Skip assemblies: colors assigned to assemblies and their instances
     // are not supported (it is not clear how to encode that in STEP)
-    if ( XCAFDoc_ShapeTool::IsAssembly ( L ) ) {
+    if (XCAFDoc_ShapeTool::IsAssembly(L)) {
 #ifdef OCCT_DEBUG
       cout << "Warning: Cannot write color  for Assembly" << endl;
       cout << "Info: Check for colors assigned to components in assembly" << endl;
 #endif
       // PTV 22.01.2003 Write color for instances.
       TDF_LabelSequence compLabels;
-      if ( aSTool.IsNull() )
+      if (aSTool.IsNull())
         continue;
       if (!aSTool->GetComponents(L, compLabels))
         continue;
       WriteColors(WS, compLabels);
       continue;
-    }
+  }
     Styles.ClearStyles();
 
     // get a target shape and try to find corresponding context
     // (all the colors set under that label will be put into that context)
     TopoDS_Shape S;
-    if ( ! XCAFDoc_ShapeTool::GetShape ( L, S ) ) continue;
-    Standard_Boolean isComponent = aSTool->IsComponent( L );
+    if (!XCAFDoc_ShapeTool::GetShape(L, S)) continue;
+    Standard_Boolean isComponent = aSTool->IsComponent(L);
     TopoDS_Shape aTopSh = S;
-    Handle(StepRepr_RepresentationContext) Context = Styles.FindContext ( S );
-    if ( isComponent ) {
+    Handle(StepRepr_RepresentationContext) Context = Styles.FindContext(S);
+    if (isComponent) {
       TDF_Label aTopShL = aSTool->FindShape(S, Standard_False);
       if (aTopShL.IsNull())
         continue;
-      aTopSh = aSTool->GetShape( aTopShL );
-      Context = Styles.FindContext ( aTopSh );
+      aTopSh = aSTool->GetShape(aTopShL);
+      Context = Styles.FindContext(aTopSh);
     }
-    if ( Context.IsNull() )
-        continue;
-    
+    if (Context.IsNull())
+      continue;
+
     // collect settings set on that label
     XCAFPrs_DataMapOfShapeStyle settings;
     TDF_LabelSequence seq;
-    seq.Append ( L );
-    XCAFDoc_ShapeTool::GetSubShapes ( L, seq );
+    seq.Append(L);
+    XCAFDoc_ShapeTool::GetSubShapes(L, seq);
     Standard_Boolean isVisible = Standard_True;
-    for ( Standard_Integer j = 1; j <= seq.Length(); j++ ) {
+    for (Standard_Integer j = 1; j <= seq.Length(); j++) {
       TDF_Label lab = seq.Value(j);
       XCAFPrs_Style style;
       Quantity_Color C;
-      if ( lab == L ) {
+      if (lab == L) {
         // check for invisible status of object on label
-        if ( !CTool->IsVisible( lab ) ) {
+        if (!CTool->IsVisible(lab)) {
           isVisible = Standard_False;
-          style.SetVisibility( Standard_False );
+          style.SetVisibility(Standard_False);
         }
       }
-      if ( CTool->GetColor ( lab, XCAFDoc_ColorGen, C ) ) {
-        style.SetColorCurv ( C );
-        style.SetColorSurf ( C );
+      if (CTool->GetColor(lab, XCAFDoc_ColorGen, C)) {
+        style.SetColorCurv(C);
+        style.SetColorSurf(C);
       }
-      if ( CTool->GetColor ( lab, XCAFDoc_ColorSurf, C ) )
-        style.SetColorSurf ( C );
-      if ( CTool->GetColor ( lab, XCAFDoc_ColorCurv, C ) )
-        style.SetColorCurv ( C );
-      
+      if (CTool->GetColor(lab, XCAFDoc_ColorSurf, C))
+        style.SetColorSurf(C);
+      if (CTool->GetColor(lab, XCAFDoc_ColorCurv, C))
+        style.SetColorCurv(C);
+
       // commented, cause we are need to take reference from 
 //       if ( isComponent && lab == L && !isVisible)
 //         if ( !style.IsSetColorSurf() && !style.IsSetColorCurv() ) {
 //           getFatherColor ( L, CTool, style);
 //         }
-      if ( ! style.IsSetColorCurv() && ! style.IsSetColorSurf() && isVisible ) continue;
+      if (!style.IsSetColorCurv() && !style.IsSetColorSurf() && isVisible) continue;
 
-      TopoDS_Shape sub = XCAFDoc_ShapeTool::GetShape ( lab );
-      settings.Bind ( sub, style );
+      TopoDS_Shape sub = XCAFDoc_ShapeTool::GetShape(lab);
+      settings.Bind(sub, style);
     }
-    
-    if ( settings.Extent() <=0 ) continue;
+
+    if (settings.Extent() <= 0) continue;
 
     // iterate on subshapes and create STEP styles
     Handle(StepVisual_StyledItem) override;
     TopTools_MapOfShape Map;
 
-    MakeSTEPStyles(Styles,S,settings,override,Map,myMapCompMDGPR,DPDCs,ColRGBs,CTool,0,isComponent);
+    MakeSTEPStyles(Styles, S, settings, override, Map, myMapCompMDGPR, DPDCs, ColRGBs, CTool, 0, isComponent);
 
     // create MDGPR and record it in model
     Handle(StepVisual_MechanicalDesignGeometricPresentationRepresentation) aMDGPR;
 
     if (!isComponent) {
-      if ( myMapCompMDGPR.IsBound( aTopSh )) {
+      if (myMapCompMDGPR.IsBound(aTopSh)) {
 #ifdef OCCT_DEBUG
         cerr << "Error: Current Top-Level shape have MDGPR already " << endl;
 #endif
-      }
+}
       Styles.CreateMDGPR(Context, aMDGPR, WS->Model());
       if (!aMDGPR.IsNull())
-        myMapCompMDGPR.Bind( aTopSh, aMDGPR );
+        myMapCompMDGPR.Bind(aTopSh, aMDGPR);
     }
     else {
       // create SDR and add to model.
       const Handle(XSControl_TransferWriter) &TW = WS->TransferWriter();
       const Handle(Transfer_FinderProcess) &FP = TW->FinderProcess();
-      Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FP, S );
+      Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper(FP, S);
       Handle(StepShape_ContextDependentShapeRepresentation) CDSR;
-      if ( FP->FindTypedTransient(mapper, 
-                                  STANDARD_TYPE(StepShape_ContextDependentShapeRepresentation),
-                                  CDSR) ) {
+      if (FP->FindTypedTransient(mapper,
+        STANDARD_TYPE(StepShape_ContextDependentShapeRepresentation),
+        CDSR)) {
         // create SDR for NAUO
         Handle(StepRepr_ProductDefinitionShape) nullPDS; // important to be NULL
-        Styles.CreateNAUOSRD( Context, CDSR, nullPDS );
-        
+        Styles.CreateNAUOSRD(Context, CDSR, nullPDS);
+
         // search for MDGPR of the component top-level shape
-        if ( myMapCompMDGPR.IsBound( aTopSh )) {
-          aMDGPR = Handle(StepVisual_MechanicalDesignGeometricPresentationRepresentation)::DownCast( myMapCompMDGPR.Find( aTopSh ) );
-        } else {
+        if (myMapCompMDGPR.IsBound(aTopSh)) {
+          aMDGPR = Handle(StepVisual_MechanicalDesignGeometricPresentationRepresentation)::DownCast(myMapCompMDGPR.Find(aTopSh));
+        }
+        else {
           aMDGPR = new StepVisual_MechanicalDesignGeometricPresentationRepresentation;
-          Handle(TCollection_HAsciiString) ReprName = new TCollection_HAsciiString ( "" );
-          aMDGPR->SetName( ReprName );
-          aMDGPR->SetContextOfItems( Context );
-          myMapCompMDGPR.Bind ( aTopSh, aMDGPR );
+          Handle(TCollection_HAsciiString) ReprName = new TCollection_HAsciiString("");
+          aMDGPR->SetName(ReprName);
+          aMDGPR->SetContextOfItems(Context);
+          myMapCompMDGPR.Bind(aTopSh, aMDGPR);
         }
         Handle(StepRepr_HArray1OfRepresentationItem) oldItems = aMDGPR->Items();
         Standard_Integer oldLengthlen = 0;
         if (!oldItems.IsNull())
           oldLengthlen = oldItems->Length();
         const Standard_Integer nbIt = oldLengthlen + Styles.NbStyles();
-        if(!nbIt)
+        if (!nbIt)
           continue;
         Handle(StepRepr_HArray1OfRepresentationItem) newItems =
           new StepRepr_HArray1OfRepresentationItem(1, nbIt);
         Standard_Integer si;
         Standard_Integer el = 1;
-        for ( si=1; si <= oldLengthlen; si++ )
-          newItems->SetValue( el++, oldItems->Value( si ) );
-        for ( si=1; si <= Styles.NbStyles(); si++ ) {
-          newItems->SetValue( el++, Styles.Style(si));
+        for (si = 1; si <= oldLengthlen; si++)
+          newItems->SetValue(el++, oldItems->Value(si));
+        for (si = 1; si <= Styles.NbStyles(); si++) {
+          newItems->SetValue(el++, Styles.Style(si));
         }
-       
+
         if (newItems->Length() > 0)
-          aMDGPR->SetItems( newItems );
+          aMDGPR->SetItems(newItems);
       } //end of work with CDSR
     }
-    if ( !isVisible ) {
-    // create invisibility item and refer for stiledItem
+    if (!isVisible) {
+      // create invisibility item and refer for stiledItem
       Handle(StepVisual_Invisibility) Invsblt = new StepVisual_Invisibility();
-      Handle(StepVisual_HArray1OfInvisibleItem) HInvsblItm = 
-        new StepVisual_HArray1OfInvisibleItem (1,Styles.NbStyles());
+      Handle(StepVisual_HArray1OfInvisibleItem) HInvsblItm =
+        new StepVisual_HArray1OfInvisibleItem(1, Styles.NbStyles());
       // put all style item into the harray
-      for ( Standard_Integer si=1; si <= Styles.NbStyles(); si++ ) {
+      for (Standard_Integer si = 1; si <= Styles.NbStyles(); si++) {
         Handle(StepRepr_RepresentationItem) styledItm = Styles.Style(si);
         StepVisual_InvisibleItem anInvItem;
-        anInvItem.SetValue( styledItm );
-        HInvsblItm->SetValue( si, anInvItem );
+        anInvItem.SetValue(styledItm);
+        HInvsblItm->SetValue(si, anInvItem);
       }
       // set the invisibility of items
-      Invsblt->Init( HInvsblItm );
-      WS->Model()->AddWithRefs( Invsblt );
+      Invsblt->Init(HInvsblItm);
+      WS->Model()->AddWithRefs(Invsblt);
     }
   }
 
@@ -1347,81 +1372,81 @@ Standard_Boolean STEPCAFControl_Writer::WriteColors (const Handle(XSControl_Work
 //purpose  :
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::WriteNames (const Handle(XSControl_WorkSession) &WS,
-                                                   const TDF_LabelSequence &labels) const
+Standard_Boolean STEPCAFControl_Writer::WriteNames(const Handle(XSControl_WorkSession) &WS,
+  const TDF_LabelSequence &labels) const
 {
-  if ( labels.Length() <=0 ) return Standard_False;
+  if (labels.Length() <= 0) return Standard_False;
 
   // get working data
   const Handle(XSControl_TransferWriter) &TW = WS->TransferWriter();
   const Handle(Transfer_FinderProcess) &FP = TW->FinderProcess();
 
   // Iterate on requested shapes
-  for ( Standard_Integer i=1; i <= labels.Length(); i++ ) {
+  for (Standard_Integer i = 1; i <= labels.Length(); i++) {
     TDF_Label L = labels.Value(i);
 
     // get name
     Handle(TCollection_HAsciiString) hName = new TCollection_HAsciiString;
-    if ( ! GetLabelName (L, hName) ) continue;
-//    Handle(TDataStd_Name) N;
-//    if ( ! L.FindAttribute ( TDataStd_Name::GetID(), N ) ) continue;
-//    TCollection_ExtendedString name = N->Get();
-//    if ( name.Length() <=0 ) continue;
-
-    // find target STEP entity for the current shape
-//    TopoDS_Shape S;
-//    if ( ! XCAFDoc_ShapeTool::GetShape ( L, S ) ) continue;
-    if ( ! myLabels.IsBound ( L ) ) continue; // not recorded as translated, skip
-    TopoDS_Shape S = myLabels.Find ( L );
+    if (!GetLabelName(L, hName)) continue;
+    //    Handle(TDataStd_Name) N;
+    //    if ( ! L.FindAttribute ( TDataStd_Name::GetID(), N ) ) continue;
+    //    TCollection_ExtendedString name = N->Get();
+    //    if ( name.Length() <=0 ) continue;
+
+        // find target STEP entity for the current shape
+    //    TopoDS_Shape S;
+    //    if ( ! XCAFDoc_ShapeTool::GetShape ( L, S ) ) continue;
+    if (!myLabels.IsBound(L)) continue; // not recorded as translated, skip
+    TopoDS_Shape S = myLabels.Find(L);
 
     Handle(StepShape_ShapeDefinitionRepresentation) SDR;
-    Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FP, S );
-    if ( ! FP->FindTypedTransient ( mapper, STANDARD_TYPE(StepShape_ShapeDefinitionRepresentation), SDR ) ) {
+    Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper(FP, S);
+    if (!FP->FindTypedTransient(mapper, STANDARD_TYPE(StepShape_ShapeDefinitionRepresentation), SDR)) {
 #ifdef OCCT_DEBUG
       cout << "Warning: Cannot find SDR for " << S.TShape()->DynamicType()->Name() << endl;
 #endif
       continue;
-    }
+  }
 
     // set the name to the PRODUCT
     Handle(StepRepr_PropertyDefinition) PropD = SDR->Definition().PropertyDefinition();
-    if ( PropD.IsNull() ) continue;
+    if (PropD.IsNull()) continue;
     Handle(StepBasic_ProductDefinition) PD = PropD->Definition().ProductDefinition();
-    if ( PD.IsNull() ) continue;
+    if (PD.IsNull()) continue;
     Handle(StepBasic_Product) Prod = PD->Formation()->OfProduct();
 
-    Prod->SetId ( hName );
-    Prod->SetName ( hName );
+    Prod->SetId(hName);
+    Prod->SetName(hName);
 
     // write names for components of assemblies
-    if ( XCAFDoc_ShapeTool::IsAssembly ( L ) ) {
+    if (XCAFDoc_ShapeTool::IsAssembly(L)) {
       TDF_LabelSequence seq;
-      XCAFDoc_ShapeTool::GetComponents ( L, seq );
-      for (Standard_Integer k=1; k <= seq.Length(); k++) {
-       TDF_Label lab = seq(k);
-
-       // get shape with correct location
-       TDF_Label Lref;
-       if ( ! XCAFDoc_ShapeTool::GetReferredShape ( lab, Lref ) || 
-            ! myLabels.IsBound ( Lref ) ) continue;
-       S = myLabels.Find ( Lref );
-       S.Move ( XCAFDoc_ShapeTool::GetLocation ( lab ) );
-       
-       hName = new TCollection_HAsciiString;
-       if ( ! GetLabelName (lab, hName) ) continue;
-       
-       // find the target CDSR corresponding to a shape
-       mapper = TransferBRep::ShapeMapper ( FP, S );
-       Handle(Transfer_Binder) binder = FP->Find ( mapper );
-       Handle(StepShape_ContextDependentShapeRepresentation) CDSR;
-       if ( ! FP->FindTypedTransient (mapper,STANDARD_TYPE(StepShape_ContextDependentShapeRepresentation), CDSR) ) 
-         continue;
-       Handle(StepRepr_ProductDefinitionShape) PDS = CDSR->RepresentedProductRelation();
-       Handle(StepBasic_ProductDefinitionRelationship) NAUO = PDS->Definition().ProductDefinitionRelationship();
-       if ( ! NAUO.IsNull() ) NAUO->SetName ( hName );
+      XCAFDoc_ShapeTool::GetComponents(L, seq);
+      for (Standard_Integer k = 1; k <= seq.Length(); k++) {
+        TDF_Label lab = seq(k);
+
+        // get shape with correct location
+        TDF_Label Lref;
+        if (!XCAFDoc_ShapeTool::GetReferredShape(lab, Lref) ||
+          !myLabels.IsBound(Lref)) continue;
+        S = myLabels.Find(Lref);
+        S.Move(XCAFDoc_ShapeTool::GetLocation(lab));
+
+        hName = new TCollection_HAsciiString;
+        if (!GetLabelName(lab, hName)) continue;
+
+        // find the target CDSR corresponding to a shape
+        mapper = TransferBRep::ShapeMapper(FP, S);
+        Handle(Transfer_Binder) binder = FP->Find(mapper);
+        Handle(StepShape_ContextDependentShapeRepresentation) CDSR;
+        if (!FP->FindTypedTransient(mapper, STANDARD_TYPE(StepShape_ContextDependentShapeRepresentation), CDSR))
+          continue;
+        Handle(StepRepr_ProductDefinitionShape) PDS = CDSR->RepresentedProductRelation();
+        Handle(StepBasic_ProductDefinitionRelationship) NAUO = PDS->Definition().ProductDefinitionRelationship();
+        if (!NAUO.IsNull()) NAUO->SetName(hName);
       }
     }
-  }
+}
 
   return Standard_True;
 }
@@ -1432,43 +1457,43 @@ Standard_Boolean STEPCAFControl_Writer::WriteNames (const Handle(XSControl_WorkS
 //purpose  :
 //=======================================================================
 static Standard_Boolean WritePropsForLabel(const Handle(XSControl_WorkSession) &WS,
-                                           const Handle(XCAFDoc_ShapeTool) &aSTool,
-                                           const STEPCAFControl_DataMapOfLabelShape &myLabels,
-                                           const TDF_Label &L,
-                                           const Standard_CString multi)
+  const Handle(XCAFDoc_ShapeTool) &aSTool,
+  const STEPCAFControl_DataMapOfLabelShape &myLabels,
+  const TDF_Label &L,
+  const Standard_CString multi)
 {
-  if(L.IsNull()) return Standard_False;
+  if (L.IsNull()) return Standard_False;
 
-  STEPConstruct_ValidationProps Props ( WS );
+  STEPConstruct_ValidationProps Props(WS);
 
   TopoDS_Shape S = aSTool->GetShape(L);
-  if(S.IsNull()) return Standard_False;
+  if (S.IsNull()) return Standard_False;
 
-  if ( ! multi || XCAFDoc_ShapeTool::IsAssembly ( L ) ) {
+  if (!multi || XCAFDoc_ShapeTool::IsAssembly(L)) {
     // write area
     Handle(XCAFDoc_Area) A;
-    L.FindAttribute ( XCAFDoc_Area::GetID(), A );
-    if ( ! A.IsNull() ) {
-      Props.AddArea ( S, A->Get() );
+    L.FindAttribute(XCAFDoc_Area::GetID(), A);
+    if (!A.IsNull()) {
+      Props.AddArea(S, A->Get());
     }
     // write volume
     Handle(XCAFDoc_Volume) V;
-    L.FindAttribute ( XCAFDoc_Volume::GetID(), V );
-    if ( ! V.IsNull() ) {
-      Props.AddVolume ( S, V->Get() );
+    L.FindAttribute(XCAFDoc_Volume::GetID(), V);
+    if (!V.IsNull()) {
+      Props.AddVolume(S, V->Get());
     }
   }
   // write centroid
   Handle(XCAFDoc_Centroid) C;
-  L.FindAttribute ( XCAFDoc_Centroid::GetID(), C );
-  if ( ! C.IsNull() ) {
-    Props.AddCentroid ( S, C->Get() );
+  L.FindAttribute(XCAFDoc_Centroid::GetID(), C);
+  if (!C.IsNull()) {
+    Props.AddCentroid(S, C->Get());
   }
 
-  if( XCAFDoc_ShapeTool::IsCompound(L) || XCAFDoc_ShapeTool::IsAssembly(L) ) {
-    if(L.HasChild()) {
-      for(Standard_Integer ich=1; ich<=L.NbChildren(); ich++) {
-        WritePropsForLabel(WS,aSTool,myLabels,L.FindChild(ich),multi);
+  if (XCAFDoc_ShapeTool::IsCompound(L) || XCAFDoc_ShapeTool::IsAssembly(L)) {
+    if (L.HasChild()) {
+      for (Standard_Integer ich = 1; ich <= L.NbChildren(); ich++) {
+        WritePropsForLabel(WS, aSTool, myLabels, L.FindChild(ich), multi);
       }
     }
   }
@@ -1482,73 +1507,73 @@ static Standard_Boolean WritePropsForLabel(const Handle(XSControl_WorkSession) &
 //purpose  :
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::WriteValProps (const Handle(XSControl_WorkSession) &WS,
-                                                      const TDF_LabelSequence &labels,
-                                                      const Standard_CString multi) const
+Standard_Boolean STEPCAFControl_Writer::WriteValProps(const Handle(XSControl_WorkSession) &WS,
+  const TDF_LabelSequence &labels,
+  const Standard_CString multi) const
 {
-  if ( labels.Length() <=0 ) return Standard_False;
+  if (labels.Length() <= 0) return Standard_False;
 
   // get working data
 //  STEPConstruct_ValidationProps Props ( WS );
-  Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool( labels(1) );
+  Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(labels(1));
 
   // Iterate on requested shapes
-  for ( Standard_Integer i=1; i <= labels.Length(); i++ ) {
+  for (Standard_Integer i = 1; i <= labels.Length(); i++) {
     TDF_Label L = labels.Value(i);
 
-    WritePropsForLabel(WS,aSTool,myLabels,L,multi);
-/*    
-    // find target STEP entity for the current shape
-    if ( ! myLabels.IsBound ( L ) ) continue; // not recorded as translated, skip
-    TopoDS_Shape S = myLabels.Find ( L );
-
-    // write area and volume (except for components in multifile mode)
-    if ( ! multi || XCAFDoc_ShapeTool::IsAssembly ( L ) ) {
-      Handle(XCAFDoc_Area) A;
-      L.FindAttribute ( XCAFDoc_Area::GetID(), A );
-      if ( ! A.IsNull() ) Props.AddArea ( S, A->Get() );
-
-      Handle(XCAFDoc_Volume) V;
-      L.FindAttribute ( XCAFDoc_Volume::GetID(), V );
-      if ( ! V.IsNull() ) Props.AddVolume ( S, V->Get() );
-    }
-
-    // write centroid
-    Handle(XCAFDoc_Centroid) C;
-    L.FindAttribute ( XCAFDoc_Centroid::GetID(), C );
-    if ( ! C.IsNull() ) Props.AddCentroid ( S, C->Get() );
+    WritePropsForLabel(WS, aSTool, myLabels, L, multi);
+    /*
+        // find target STEP entity for the current shape
+        if ( ! myLabels.IsBound ( L ) ) continue; // not recorded as translated, skip
+        TopoDS_Shape S = myLabels.Find ( L );
+
+        // write area and volume (except for components in multifile mode)
+        if ( ! multi || XCAFDoc_ShapeTool::IsAssembly ( L ) ) {
+          Handle(XCAFDoc_Area) A;
+          L.FindAttribute ( XCAFDoc_Area::GetID(), A );
+          if ( ! A.IsNull() ) Props.AddArea ( S, A->Get() );
+
+          Handle(XCAFDoc_Volume) V;
+          L.FindAttribute ( XCAFDoc_Volume::GetID(), V );
+          if ( ! V.IsNull() ) Props.AddVolume ( S, V->Get() );
+        }
 
-    // write centroid for components of assemblies
-    if ( XCAFDoc_ShapeTool::IsAssembly ( L ) ) {
-      TDF_LabelSequence seq;
-      XCAFDoc_ShapeTool::GetComponents ( L, seq );
-      for (Standard_Integer k=1; k <= seq.Length(); k++) {
-       TDF_Label lab = seq(k);
-
-       // get shape with correct location
-       TDF_Label Lref;
-       if ( ! XCAFDoc_ShapeTool::GetReferredShape ( lab, Lref ) || 
-            ! myLabels.IsBound ( Lref ) ) continue;
-       TopLoc_Location Loc = XCAFDoc_ShapeTool::GetLocation ( lab );
-       S = myLabels.Find ( Lref );
-       S.Move ( Loc );
-               
-       C.Nullify();
-       lab.FindAttribute ( XCAFDoc_Centroid::GetID(), C );
-       // if centroid is not assigned to an instance, 
-       // use (shifted) centroid of original shape
-       gp_Pnt center;
-       if ( C.IsNull() ) {
-         Lref.FindAttribute ( XCAFDoc_Centroid::GetID(), C );
-         if ( C.IsNull() ) continue;
-         center = C->Get().Transformed ( Loc.Transformation() );
-       }
-       else center = C->Get();
-
-       Props.AddCentroid ( S, center, Standard_True );
+        // write centroid
+        Handle(XCAFDoc_Centroid) C;
+        L.FindAttribute ( XCAFDoc_Centroid::GetID(), C );
+        if ( ! C.IsNull() ) Props.AddCentroid ( S, C->Get() );
+
+        // write centroid for components of assemblies
+        if ( XCAFDoc_ShapeTool::IsAssembly ( L ) ) {
+          TDF_LabelSequence seq;
+          XCAFDoc_ShapeTool::GetComponents ( L, seq );
+          for (Standard_Integer k=1; k <= seq.Length(); k++) {
+      TDF_Label lab = seq(k);
+
+      // get shape with correct location
+      TDF_Label Lref;
+      if ( ! XCAFDoc_ShapeTool::GetReferredShape ( lab, Lref ) ||
+           ! myLabels.IsBound ( Lref ) ) continue;
+      TopLoc_Location Loc = XCAFDoc_ShapeTool::GetLocation ( lab );
+      S = myLabels.Find ( Lref );
+      S.Move ( Loc );
+
+      C.Nullify();
+      lab.FindAttribute ( XCAFDoc_Centroid::GetID(), C );
+      // if centroid is not assigned to an instance,
+      // use (shifted) centroid of original shape
+      gp_Pnt center;
+      if ( C.IsNull() ) {
+        Lref.FindAttribute ( XCAFDoc_Centroid::GetID(), C );
+        if ( C.IsNull() ) continue;
+        center = C->Get().Transformed ( Loc.Transformation() );
       }
-    }
-*/
+      else center = C->Get();
+
+      Props.AddCentroid ( S, center, Standard_True );
+          }
+        }
+    */
   }
 
   return Standard_True;
@@ -1560,63 +1585,63 @@ Standard_Boolean STEPCAFControl_Writer::WriteValProps (const Handle(XSControl_Wo
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::WriteLayers (const Handle(XSControl_WorkSession) &WS,
-                                                    const TDF_LabelSequence  &labels ) const
+Standard_Boolean STEPCAFControl_Writer::WriteLayers(const Handle(XSControl_WorkSession) &WS,
+  const TDF_LabelSequence  &labels) const
 {
-  
-  if ( labels.Length() <=0 ) return Standard_False;
+
+  if (labels.Length() <= 0) return Standard_False;
 
   // get working data
   const Handle(Interface_InterfaceModel) &Model = WS->Model();
   const Handle(XSControl_TransferWriter) &TW = WS->TransferWriter();
   const Handle(Transfer_FinderProcess) &FP = TW->FinderProcess();
-  Handle(XCAFDoc_LayerTool) LTool = XCAFDoc_DocumentTool::LayerTool( labels(1) );
-  if (LTool.IsNull() ) return Standard_False;
+  Handle(XCAFDoc_LayerTool) LTool = XCAFDoc_DocumentTool::LayerTool(labels(1));
+  if (LTool.IsNull()) return Standard_False;
 
   TDF_LabelSequence LayerLS;
   LTool->GetLayerLabels(LayerLS);
-  if ( LayerLS.Length() <=0 ) return Standard_False;
+  if (LayerLS.Length() <= 0) return Standard_False;
 
   // Iterate on requested layers and for each layer take set of shapes.
-  for ( Standard_Integer i=1; i <= LayerLS.Length(); i++ ) {
+  for (Standard_Integer i = 1; i <= LayerLS.Length(); i++) {
     TDF_Label L = LayerLS.Value(i);
-    
+
     // get labels of shapes in that layer
     TDF_LabelSequence ShapeLs;
     LTool->GetShapesOfLayer(L, ShapeLs);
-    if ( ShapeLs.Length() <=0 ) continue;
-    
+    if (ShapeLs.Length() <= 0) continue;
+
     // name of layer: if not set, is considered as being empty
     Handle(TCollection_HAsciiString) hName = new TCollection_HAsciiString;
-    GetLabelName ( L, hName );
+    GetLabelName(L, hName);
 
     // Find target STEP entity for each shape and add to StepVisual_PresentationLayerAssignment items.
     TColStd_SequenceOfTransient seqRI;
-    for ( Standard_Integer j=1; j <= ShapeLs.Length(); j++) {
+    for (Standard_Integer j = 1; j <= ShapeLs.Length(); j++) {
       TDF_Label shLabel = ShapeLs.Value(j);
-      if ( shLabel.IsNull() ) continue;
-      
+      if (shLabel.IsNull()) continue;
+
       // there is no way to assign layer to instance in STEP
-      if ( XCAFDoc_ShapeTool::IsAssembly ( shLabel ) ||
-           XCAFDoc_ShapeTool::IsReference ( shLabel ) )
+      if (XCAFDoc_ShapeTool::IsAssembly(shLabel) ||
+        XCAFDoc_ShapeTool::IsReference(shLabel))
         continue;
-      
+
       // check that the shape is one of (uub)labels written during current transfer
       Standard_Integer k = 1;
-      for ( ; k <= labels.Length(); k++ )
-       if ( shLabel.IsDescendant ( labels(k) ) ) break;
-      if ( k > labels.Length() ) continue;
+      for (; k <= labels.Length(); k++)
+        if (shLabel.IsDescendant(labels(k))) break;
+      if (k > labels.Length()) continue;
 
       // get target STEP entity
       TopoDS_Shape oneShape = XCAFDoc_ShapeTool::GetShape(shLabel);
-      
+
       TopLoc_Location Loc;
-      Standard_Integer nb = 
-       FindEntities ( FP, oneShape, Loc, seqRI );
-      if ( nb <=0 ) 
-       FP->Messenger() << "Warning: Cannot find RI for " << oneShape.TShape()->DynamicType()->Name() << endl;
+      Standard_Integer nb =
+        FindEntities(FP, oneShape, Loc, seqRI);
+      if (nb <= 0)
+        FP->Messenger() << "Warning: Cannot find RI for " << oneShape.TShape()->DynamicType()->Name() << endl;
     }
-    if ( seqRI.Length() <= 0 ) continue;
+    if (seqRI.Length() <= 0) continue;
 
     // analyze visibility
     Handle(StepVisual_PresentationLayerAssignment) StepLayerAs = new StepVisual_PresentationLayerAssignment;
@@ -1624,38 +1649,38 @@ Standard_Boolean STEPCAFControl_Writer::WriteLayers (const Handle(XSControl_Work
     Handle(TDataStd_UAttribute) aUAttr;
     Standard_Boolean isLinv = Standard_False;
     if (L.FindAttribute(XCAFDoc::InvisibleGUID(), aUAttr)) {
-      descr = new TCollection_HAsciiString ("invisible");
+      descr = new TCollection_HAsciiString("invisible");
 #ifdef OCCT_DEBUG
-      FP->Messenger() << "\tLayer \"" << hName->String().ToCString() << "\" is invisible"<<endl;
+      FP->Messenger() << "\tLayer \"" << hName->String().ToCString() << "\" is invisible" << endl;
 #endif
       isLinv = Standard_True;
-    }
-    else descr = new TCollection_HAsciiString ("visible");
-    
+  }
+    else descr = new TCollection_HAsciiString("visible");
+
     // create layer entity
-    Handle(StepVisual_HArray1OfLayeredItem) HArrayOfLItem = 
-      new StepVisual_HArray1OfLayeredItem ( 1, seqRI.Length() );
-    for (Standard_Integer i1 = 1; i1<=seqRI.Length(); i1++) {
+    Handle(StepVisual_HArray1OfLayeredItem) HArrayOfLItem =
+      new StepVisual_HArray1OfLayeredItem(1, seqRI.Length());
+    for (Standard_Integer i1 = 1; i1 <= seqRI.Length(); i1++) {
       StepVisual_LayeredItem LI;
-      LI.SetValue ( seqRI.Value(i1) );
-      HArrayOfLItem->SetValue( i1, LI );
+      LI.SetValue(seqRI.Value(i1));
+      HArrayOfLItem->SetValue(i1, LI);
     }
     StepLayerAs->Init(hName, descr, HArrayOfLItem);
-    Model->AddWithRefs( StepLayerAs );
+    Model->AddWithRefs(StepLayerAs);
     // PTV 23.01.2003 add the invisibility AFTER adding layer into the model.
     // add the invisibility for the layer
     if (isLinv) {
       // Invisibility Item for containig invisible layers.
-      Handle(StepVisual_HArray1OfInvisibleItem) HInvsblItm = new StepVisual_HArray1OfInvisibleItem (1,1);
+      Handle(StepVisual_HArray1OfInvisibleItem) HInvsblItm = new StepVisual_HArray1OfInvisibleItem(1, 1);
       StepVisual_InvisibleItem InvIt;
-      InvIt.SetValue( StepLayerAs );
-      HInvsblItm->SetValue( 1, InvIt);
-      
+      InvIt.SetValue(StepLayerAs);
+      HInvsblItm->SetValue(1, InvIt);
+
       Handle(StepVisual_Invisibility) Invsblt = new StepVisual_Invisibility();
-      Invsblt->Init( HInvsblItm );
-      Model->AddWithRefs( Invsblt );
+      Invsblt->Init(HInvsblItm);
+      Model->AddWithRefs(Invsblt);
     }
-  }
+}
   return Standard_True;
 }
 
@@ -1665,25 +1690,25 @@ Standard_Boolean STEPCAFControl_Writer::WriteLayers (const Handle(XSControl_Work
 //purpose  : auxilary
 //=======================================================================
 static Standard_Boolean getSHUOstyle(const TDF_Label& aSHUOlab,
-                                     const Handle(XCAFDoc_ColorTool)& CTool,
-                                     XCAFPrs_Style& SHUOstyle)
+  const Handle(XCAFDoc_ColorTool)& CTool,
+  XCAFPrs_Style& SHUOstyle)
 {
   Quantity_Color C;
-  if (!CTool->IsVisible( aSHUOlab ) )
+  if (!CTool->IsVisible(aSHUOlab))
     SHUOstyle.SetVisibility(Standard_False);
   else {
-    if ( CTool->GetColor ( aSHUOlab, XCAFDoc_ColorGen, C ) ) {
-      SHUOstyle.SetColorCurv ( C );
-      SHUOstyle.SetColorSurf ( C );
+    if (CTool->GetColor(aSHUOlab, XCAFDoc_ColorGen, C)) {
+      SHUOstyle.SetColorCurv(C);
+      SHUOstyle.SetColorSurf(C);
     }
-    if ( CTool->GetColor ( aSHUOlab, XCAFDoc_ColorSurf, C ) )
-      SHUOstyle.SetColorSurf ( C );
-    if ( CTool->GetColor ( aSHUOlab, XCAFDoc_ColorCurv, C ) )
-      SHUOstyle.SetColorCurv ( C );
+    if (CTool->GetColor(aSHUOlab, XCAFDoc_ColorSurf, C))
+      SHUOstyle.SetColorSurf(C);
+    if (CTool->GetColor(aSHUOlab, XCAFDoc_ColorCurv, C))
+      SHUOstyle.SetColorCurv(C);
   }
-  if ( !SHUOstyle.IsSetColorCurv() && 
-      !SHUOstyle.IsSetColorSurf() &&
-      SHUOstyle.IsVisible() )
+  if (!SHUOstyle.IsSetColorCurv() &&
+    !SHUOstyle.IsSetColorSurf() &&
+    SHUOstyle.IsVisible())
     return Standard_False;
   return Standard_True;
 }
@@ -1694,21 +1719,21 @@ static Standard_Boolean getSHUOstyle(const TDF_Label& aSHUOlab,
 //purpose  : auxilary
 //=======================================================================
 static Standard_Boolean getProDefinitionOfNAUO(const Handle(XSControl_WorkSession)& WS,
-                                               const TopoDS_Shape& theShape,
-                                               Handle(StepBasic_ProductDefinition)& PD,
-                                               Handle(StepRepr_NextAssemblyUsageOccurrence)& NAUO,
-                                               Standard_Boolean IsRelating)
+  const TopoDS_Shape& theShape,
+  Handle(StepBasic_ProductDefinition)& PD,
+  Handle(StepRepr_NextAssemblyUsageOccurrence)& NAUO,
+  Standard_Boolean IsRelating)
 {
-  if ( theShape.IsNull() )
+  if (theShape.IsNull())
     return Standard_False;
   // get CDSR
   const Handle(XSControl_TransferWriter) &TW = WS->TransferWriter();
   const Handle(Transfer_FinderProcess) &FP = TW->FinderProcess();
   Handle(StepShape_ContextDependentShapeRepresentation) CDSR;
-  Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FP, theShape );
-  if (!FP->FindTypedTransient(mapper, 
-                              STANDARD_TYPE(StepShape_ContextDependentShapeRepresentation),
-                              CDSR))
+  Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper(FP, theShape);
+  if (!FP->FindTypedTransient(mapper,
+    STANDARD_TYPE(StepShape_ContextDependentShapeRepresentation),
+    CDSR))
     return Standard_False;
   // get PDS of NAUO
   Handle(StepRepr_ProductDefinitionShape) PDS = CDSR->RepresentedProductRelation();
@@ -1717,20 +1742,20 @@ static Standard_Boolean getProDefinitionOfNAUO(const Handle(XSControl_WorkSessio
   // get the NAUO entity
   Interface_Graph aGraph = WS->HGraph()->Graph();
   Interface_EntityIterator subs = aGraph.Shareds(PDS);
-  for ( subs.Start(); subs.More(); subs.Next() ) {
+  for (subs.Start(); subs.More(); subs.Next()) {
     if (!subs.Value()->IsKind(STANDARD_TYPE(StepRepr_NextAssemblyUsageOccurrence)))
       continue;
     NAUO = Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast(subs.Value());
     break;
   }
-  if ( NAUO.IsNull() )
+  if (NAUO.IsNull())
     return Standard_False;
   // get Relatinf or Related product definition
-  if ( !IsRelating )
+  if (!IsRelating)
     PD = NAUO->RelatedProductDefinition();
   else
     PD = NAUO->RelatingProductDefinition();
-  if ( PD.IsNull() )
+  if (PD.IsNull())
     return Standard_False;
   return Standard_True;
 }
@@ -1740,99 +1765,99 @@ static Standard_Boolean getProDefinitionOfNAUO(const Handle(XSControl_WorkSessio
 //function : writeSHUO
 //purpose  : auxilary
 //=======================================================================
-static Standard_Boolean writeSHUO (const Handle(XCAFDoc_GraphNode)& theSHUO,
-                                   const Handle(XCAFDoc_ShapeTool)& theSTool,
-                                   const Handle(XSControl_WorkSession)& WS,
-                                   Handle(StepRepr_SpecifiedHigherUsageOccurrence)& theTopSHUO,
-                                   TopoDS_Shape& NAUOShape,
-                                   Handle(StepBasic_ProductDefinition)& theRelatingPD,
-                                   Standard_Boolean& isDeepest)
+static Standard_Boolean writeSHUO(const Handle(XCAFDoc_GraphNode)& theSHUO,
+  const Handle(XCAFDoc_ShapeTool)& theSTool,
+  const Handle(XSControl_WorkSession)& WS,
+  Handle(StepRepr_SpecifiedHigherUsageOccurrence)& theTopSHUO,
+  TopoDS_Shape& NAUOShape,
+  Handle(StepBasic_ProductDefinition)& theRelatingPD,
+  Standard_Boolean& isDeepest)
 {
   // set the ProductDefinitionRelationship descriptin information as empty strings.
   Handle(TCollection_HAsciiString) EmptyString = new TCollection_HAsciiString("");
-  
+
   TDF_LabelSequence aNextUsageLabs;
-  theSTool->GetSHUONextUsage( theSHUO->Label(), aNextUsageLabs );
+  theSTool->GetSHUONextUsage(theSHUO->Label(), aNextUsageLabs);
   Handle(XCAFDoc_GraphNode) NuSHUO;
-  if ( theTopSHUO.IsNull() ) {
+  if (theTopSHUO.IsNull()) {
     // the top SHUO
     if (aNextUsageLabs.Length() < 1)
       return Standard_False;
-    theSTool->GetSHUO( aNextUsageLabs.Value(1), NuSHUO );
+    theSTool->GetSHUO(aNextUsageLabs.Value(1), NuSHUO);
     if (NuSHUO.IsNull())
       return Standard_False;
     // get relating product definition
-    TopoDS_Shape aTopCompShape = theSTool->GetShape( theSHUO->Label().Father() ); 
+    TopoDS_Shape aTopCompShape = theSTool->GetShape(theSHUO->Label().Father());
     Handle(StepRepr_NextAssemblyUsageOccurrence) UUNAUO;
-    if (!getProDefinitionOfNAUO( WS, aTopCompShape,
-                                 theRelatingPD, UUNAUO, Standard_True ))
+    if (!getProDefinitionOfNAUO(WS, aTopCompShape,
+      theRelatingPD, UUNAUO, Standard_True))
       return Standard_False;
     // get related product definition
-    TopoDS_Shape aNUShape = theSTool->GetShape( NuSHUO->Label().Father() );
+    TopoDS_Shape aNUShape = theSTool->GetShape(NuSHUO->Label().Father());
     Handle(StepBasic_ProductDefinition) aRelatedPD;
     Handle(StepRepr_NextAssemblyUsageOccurrence) NUNAUO;
-    if (!getProDefinitionOfNAUO( WS, aNUShape,
-                                 aRelatedPD, NUNAUO, Standard_False ))
+    if (!getProDefinitionOfNAUO(WS, aNUShape,
+      aRelatedPD, NUNAUO, Standard_False))
       return Standard_False;
-    
+
     theTopSHUO = new StepRepr_SpecifiedHigherUsageOccurrence;
     // create deepest shuo EmptyString
     theTopSHUO->Init(/*id*/EmptyString, /*name*/EmptyString,
-                     /*no description*/Standard_False,/*description*/EmptyString,
-                     theRelatingPD, aRelatedPD,
-                     /*no ACURefDesignator*/Standard_False,/*ACURefDesignator*/EmptyString,
-                     /*upper_usage*/UUNAUO, /*next_usage*/NUNAUO);
+      /*no description*/Standard_False,/*description*/EmptyString,
+      theRelatingPD, aRelatedPD,
+      /*no ACURefDesignator*/Standard_False,/*ACURefDesignator*/EmptyString,
+      /*upper_usage*/UUNAUO, /*next_usage*/NUNAUO);
     // write the other SHUO.
-    if(!writeSHUO( NuSHUO, theSTool, WS, theTopSHUO, NAUOShape, theRelatingPD, isDeepest )) {
+    if (!writeSHUO(NuSHUO, theSTool, WS, theTopSHUO, NAUOShape, theRelatingPD, isDeepest)) {
       theTopSHUO.Nullify();
       return Standard_False;
     }
-    
+
     return Standard_True;
   }
-//   Handle(XCAFDoc_GraphNode) NuSHUO;
-  if ( aNextUsageLabs.Length() > 0) {
+  //   Handle(XCAFDoc_GraphNode) NuSHUO;
+  if (aNextUsageLabs.Length() > 0) {
     // store SHUO recursive
 #ifdef OCCT_DEBUG
-    if ( aNextUsageLabs.Length() > 1 )
-      cout << "Warning: store only one next_usage of current SHUO"  << endl;
+    if (aNextUsageLabs.Length() > 1)
+      cout << "Warning: store only one next_usage of current SHUO" << endl;
 #endif    
-    theSTool->GetSHUO( aNextUsageLabs.Value(1), NuSHUO );
+    theSTool->GetSHUO(aNextUsageLabs.Value(1), NuSHUO);
     Handle(StepRepr_SpecifiedHigherUsageOccurrence) aNUEntSHUO =
       new StepRepr_SpecifiedHigherUsageOccurrence;
-    if (!writeSHUO( NuSHUO, theSTool, WS, aNUEntSHUO, NAUOShape, theRelatingPD, isDeepest ))
+    if (!writeSHUO(NuSHUO, theSTool, WS, aNUEntSHUO, NAUOShape, theRelatingPD, isDeepest))
       return Standard_False;
-    
+
     // store the deepest SHUO to the dociment
     TopoDS_Shape aNUSh, aUUSh;
-    aNUSh = theSTool->GetShape( NuSHUO->Label().Father() );
-    aUUSh = theSTool->GetShape( theSHUO->Label().Father() );
+    aNUSh = theSTool->GetShape(NuSHUO->Label().Father());
+    aUUSh = theSTool->GetShape(theSHUO->Label().Father());
     // get relating PD with upper_usage and related PD with next_usage
     Handle(StepBasic_ProductDefinition) nullPD;// no need to use,case have shared <theRelatingPD>
     Handle(StepBasic_ProductDefinition) aRelatedPD;
     Handle(StepRepr_NextAssemblyUsageOccurrence) UUNAUO, NUNAUO;
-    if (!getProDefinitionOfNAUO( WS, aUUSh, nullPD, UUNAUO, Standard_True ) ||
-        !getProDefinitionOfNAUO( WS, aNUSh, aRelatedPD, NUNAUO, Standard_False )) {
+    if (!getProDefinitionOfNAUO(WS, aUUSh, nullPD, UUNAUO, Standard_True) ||
+      !getProDefinitionOfNAUO(WS, aNUSh, aRelatedPD, NUNAUO, Standard_False)) {
 #ifdef OCCT_DEBUG
       cout << "Warning: cannot get related or relating PD" << endl;
 #endif
       return Standard_False;
-    }
+}
     aNUEntSHUO->Init(/*id*/EmptyString, /*name*/EmptyString,
-                     /*no description*/Standard_False,/*description*/EmptyString,
-                     theRelatingPD, aRelatedPD,
-                     /*no ACURefDesignator*/Standard_False,/*ACURefDesignator*/EmptyString,
-                     /*upper_usage*/theTopSHUO, /*next_usage*/NUNAUO);
-    if ( isDeepest ) {
+      /*no description*/Standard_False,/*description*/EmptyString,
+      theRelatingPD, aRelatedPD,
+      /*no ACURefDesignator*/Standard_False,/*ACURefDesignator*/EmptyString,
+      /*upper_usage*/theTopSHUO, /*next_usage*/NUNAUO);
+    if (isDeepest) {
       isDeepest = Standard_False;
     }
-    WS->Model()->AddWithRefs ( aNUEntSHUO );
+    WS->Model()->AddWithRefs(aNUEntSHUO);
     return Standard_True;
   } // end of recurse storing
-    
+
   // get shape 
   TDF_Label aShapeL = theSHUO->Label().Father();
-  NAUOShape = theSTool->GetShape( aShapeL );
+  NAUOShape = theSTool->GetShape(aShapeL);
   // return to the deepest level from SHUO shape level
   // it is because SHUO is attribute on deep level and shape level.
   isDeepest = Standard_True;
@@ -1844,88 +1869,88 @@ static Standard_Boolean writeSHUO (const Handle(XCAFDoc_GraphNode)& theSHUO,
 //function : createSHUOStyledItem
 //purpose  : auxilary
 //=======================================================================
-static Standard_Boolean createSHUOStyledItem (const XCAFPrs_Style& style,
-                                              const Handle(StepRepr_ProductDefinitionShape)& PDS,
-                                              const Handle(XSControl_WorkSession) &WS,
-                                              const TopoDS_Shape& Sh,
-                                              const Handle(XCAFDoc_ShapeTool)& STool,
-                                              MoniTool_DataMapOfShapeTransient& myMapCompMDGPR)
+static Standard_Boolean createSHUOStyledItem(const XCAFPrs_Style& style,
+  const Handle(StepRepr_ProductDefinitionShape)& PDS,
+  const Handle(XSControl_WorkSession) &WS,
+  const TopoDS_Shape& Sh,
+  const Handle(XCAFDoc_ShapeTool)& STool,
+  MoniTool_DataMapOfShapeTransient& myMapCompMDGPR)
 {
   // create styled item for the indicated SHUO and store to the model
-  STEPConstruct_Styles Styles( WS );
+  STEPConstruct_Styles Styles(WS);
   // translate colors to STEP
   Handle(StepVisual_Colour) surfColor, curvColor;
-  if ( style.IsSetColorSurf() )
-    surfColor = Styles.EncodeColor ( style.GetColorSurf() );
-  if ( style.IsSetColorCurv() )
-    curvColor = Styles.EncodeColor ( style.GetColorCurv() );
+  if (style.IsSetColorSurf())
+    surfColor = Styles.EncodeColor(style.GetColorSurf());
+  if (style.IsSetColorCurv())
+    curvColor = Styles.EncodeColor(style.GetColorCurv());
   Standard_Boolean isComponent = Standard_True;// cause need to get PSBC
   Handle(StepRepr_RepresentationItem) item;
   // set default color for invisible SHUO.
   Standard_Boolean isSetDefaultColor = Standard_False;
-  if (surfColor.IsNull() && curvColor.IsNull() && !style.IsVisible() ) {
-    surfColor = Styles.EncodeColor ( Quantity_Color( 1, 1, 1, Quantity_TOC_RGB ) );
+  if (surfColor.IsNull() && curvColor.IsNull() && !style.IsVisible()) {
+    surfColor = Styles.EncodeColor(Quantity_Color(1, 1, 1, Quantity_TOC_RGB));
     isSetDefaultColor = Standard_True;
   }
   Handle(StepVisual_PresentationStyleAssignment) PSA =
-    Styles.MakeColorPSA ( item, surfColor, curvColor, isComponent );
+    Styles.MakeColorPSA(item, surfColor, curvColor, isComponent);
   Handle(StepVisual_StyledItem) override; //null styled item
-  
+
   // find the repr item of the shape
   const Handle(XSControl_TransferWriter) &TW = WS->TransferWriter();
   const Handle(Transfer_FinderProcess) &FP = TW->FinderProcess();
-  Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper ( FP, Sh );
+  Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper(FP, Sh);
   Handle(StepShape_ContextDependentShapeRepresentation) CDSR;
-  FP->FindTypedTransient(mapper, 
-                         STANDARD_TYPE(StepShape_ContextDependentShapeRepresentation),
-                         CDSR);
-  if ( CDSR.IsNull() )
+  FP->FindTypedTransient(mapper,
+    STANDARD_TYPE(StepShape_ContextDependentShapeRepresentation),
+    CDSR);
+  if (CDSR.IsNull())
     return Standard_False;
   // find context
-  Handle(StepRepr_RepresentationContext) Context = Styles.FindContext( Sh );
+  Handle(StepRepr_RepresentationContext) Context = Styles.FindContext(Sh);
   TopoDS_Shape aTopSh = Sh;
   if (Context.IsNull()) {
     TDF_Label aTopShL = STool->FindShape(Sh, Standard_False);
     if (aTopShL.IsNull())
       return Standard_False;
-    aTopSh = STool->GetShape( aTopShL );
-    Context = Styles.FindContext ( aTopSh );
+    aTopSh = STool->GetShape(aTopShL);
+    Context = Styles.FindContext(aTopSh);
   }
   if (Context.IsNull())
     return Standard_False;
   // get representation item of the shape
   TopLoc_Location L;
   TColStd_SequenceOfTransient seqRI;
-  FindEntities ( FP, Sh, L, seqRI );
+  FindEntities(FP, Sh, L, seqRI);
 #ifdef OCCT_DEBUG
-  if ( seqRI.Length() <=0 ) 
+  if (seqRI.Length() <= 0)
     FP->Messenger() << "Warning: Cannot find RI for " << Sh.TShape()->DynamicType()->Name() << endl;
 #endif
   item = Handle(StepRepr_RepresentationItem)::DownCast(seqRI(1));
   //get overridden styled item
-  getStyledItem(Sh,STool, Styles, override,myMapCompMDGPR);
-  
+  getStyledItem(Sh, STool, Styles, override, myMapCompMDGPR);
+
   // get STEP STYLED ITEM
-  Handle(StepVisual_StyledItem) STEPstyle = Styles.AddStyle ( item, PSA, override );
+  Handle(StepVisual_StyledItem) STEPstyle = Styles.AddStyle(item, PSA, override);
   // create SR, SDR and all necessary references between them and ST, PDS, PSBC, GRC
-  Styles.CreateNAUOSRD( Context, CDSR, PDS );
-  
+  Styles.CreateNAUOSRD(Context, CDSR, PDS);
+
   // add step styled item of SHUO to the model
   // do it by additing styled item to the MDGPR
-  if ( !aTopSh.IsNull() &&  !myMapCompMDGPR.IsBound( aTopSh ) ) {
+  if (!aTopSh.IsNull() && !myMapCompMDGPR.IsBound(aTopSh)) {
     // create MDGPR and record it in model
 #ifdef OCCT_DEBUG
-    cout << "Warning: " << __FILE__ << ": Create new MDGPR for SHUO instance"  << endl;
+    cout << "Warning: " << __FILE__ << ": Create new MDGPR for SHUO instance" << endl;
 #endif
     Handle(StepVisual_MechanicalDesignGeometricPresentationRepresentation) aMDGPR;
-    Styles.CreateMDGPR ( Context, aMDGPR, WS->Model());
+    Styles.CreateMDGPR(Context, aMDGPR, WS->Model());
     if (!aMDGPR.IsNull())
-      myMapCompMDGPR.Bind( aTopSh, aMDGPR );
-  }
-  else if ( !aTopSh.IsNull() &&  myMapCompMDGPR.IsBound( aTopSh ) ) {
+      myMapCompMDGPR.Bind(aTopSh, aMDGPR);
+}
+  else if (!aTopSh.IsNull() && myMapCompMDGPR.IsBound(aTopSh)) {
     // get MDGPR of the top-level shape
-    Handle(StepVisual_PresentationRepresentation) aMDGPR = 
-      Handle(StepVisual_PresentationRepresentation)::DownCast( myMapCompMDGPR.Find( aTopSh ) );
+    Handle(StepVisual_PresentationRepresentation) aMDGPR =
+      Handle(StepVisual_PresentationRepresentation)::DownCast(myMapCompMDGPR.Find(aTopSh));
     // get old styled items to not lose it
     Handle(StepRepr_HArray1OfRepresentationItem) oldItems = aMDGPR->Items();
     Standard_Integer oldLengthlen = 0;
@@ -1936,38 +1961,38 @@ static Standard_Boolean createSHUOStyledItem (const XCAFPrs_Style& style,
       new StepRepr_HArray1OfRepresentationItem(1, oldLengthlen + 1);
     Standard_Integer si;
     Standard_Integer el = 1;
-    for ( si=1; si <= oldLengthlen; si++ )
-      newItems->SetValue( el++, oldItems->Value( si ) );
-    newItems->SetValue (el++, STEPstyle);
+    for (si = 1; si <= oldLengthlen; si++)
+      newItems->SetValue(el++, oldItems->Value(si));
+    newItems->SetValue(el++, STEPstyle);
     // init MDGPR be new array of styled items
     if (newItems->Length() > 0)
-      aMDGPR->SetItems( newItems );
+      aMDGPR->SetItems(newItems);
   }
   else {
-    WS->Model()->AddWithRefs ( STEPstyle ); // add as root to the model, but it is not good
+    WS->Model()->AddWithRefs(STEPstyle); // add as root to the model, but it is not good
 #ifdef OCCT_DEBUG
     cout << "Warning: " << __FILE__ << ": adds styled item of SHUO as root, casue cannot find MDGPR" << endl;
 #endif
   }
   // create invisibility item for the styled item
-  if ( !style.IsVisible() ) {
+  if (!style.IsVisible()) {
     if (isSetDefaultColor) {
       // try to set default color from top-level shape
-      
+
       setDefaultInstanceColor(override, PSA);
     }
     // create invisibility item and refer for stiledItem
     Handle(StepVisual_Invisibility) Invsblt = new StepVisual_Invisibility();
-    Handle(StepVisual_HArray1OfInvisibleItem) HInvsblItm = 
-      new StepVisual_HArray1OfInvisibleItem (1,1);
+    Handle(StepVisual_HArray1OfInvisibleItem) HInvsblItm =
+      new StepVisual_HArray1OfInvisibleItem(1, 1);
     // put all style item into the harray
     StepVisual_InvisibleItem anInvItem;
-    anInvItem.SetValue( STEPstyle );
-    HInvsblItm->SetValue( 1, anInvItem );
-    Invsblt->Init( HInvsblItm );
-    WS->Model()->AddWithRefs( Invsblt );
+    anInvItem.SetValue(STEPstyle);
+    HInvsblItm->SetValue(1, anInvItem);
+    Invsblt->Init(HInvsblItm);
+    WS->Model()->AddWithRefs(Invsblt);
   }
-  
+
   return Standard_True;
 }
 
@@ -1977,59 +2002,59 @@ static Standard_Boolean createSHUOStyledItem (const XCAFPrs_Style& style,
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::WriteSHUOs (const Handle(XSControl_WorkSession) &WS,
-                                                    const TDF_LabelSequence  &labels )
+Standard_Boolean STEPCAFControl_Writer::WriteSHUOs(const Handle(XSControl_WorkSession) &WS,
+  const TDF_LabelSequence  &labels)
 {
-  if ( labels.Length() <=0 ) return Standard_False;
+  if (labels.Length() <= 0) return Standard_False;
 
   // get working data
-  Handle(XCAFDoc_ColorTool) CTool = XCAFDoc_DocumentTool::ColorTool( labels(1) );
-  if (CTool.IsNull() )
+  Handle(XCAFDoc_ColorTool) CTool = XCAFDoc_DocumentTool::ColorTool(labels(1));
+  if (CTool.IsNull())
     return Standard_False;
   // map of transfered SHUO
   TColStd_MapOfTransient aMapOfMainSHUO;
   // Iterate on requested shapes
-  for ( Standard_Integer i=1; i <= labels.Length(); i++ ) {
+  for (Standard_Integer i = 1; i <= labels.Length(); i++) {
     TDF_Label L = labels.Value(i);
-    if ( ! myLabels.IsBound ( L ) ) continue; // not recorded as translated, skip
-    if ( XCAFDoc_ShapeTool::IsAssembly ( L ) ) {
+    if (!myLabels.IsBound(L)) continue; // not recorded as translated, skip
+    if (XCAFDoc_ShapeTool::IsAssembly(L)) {
       TDF_LabelSequence seq;
-      XCAFDoc_ShapeTool::GetComponents ( L, seq );
+      XCAFDoc_ShapeTool::GetComponents(L, seq);
       // iterates on components of assembly
-      for (Standard_Integer k=1; k <= seq.Length(); k++) {
-       TDF_Label lab = seq(k);
+      for (Standard_Integer k = 1; k <= seq.Length(); k++) {
+        TDF_Label lab = seq(k);
         TDF_AttributeSequence anAttrSeq;
-        CTool->ShapeTool()->GetAllComponentSHUO( lab, anAttrSeq );
+        CTool->ShapeTool()->GetAllComponentSHUO(lab, anAttrSeq);
         // work with SHUO
         for (Standard_Integer j = 1; j <= anAttrSeq.Length(); j++) {
-          Handle(XCAFDoc_GraphNode) aSHUO = 
-            Handle(XCAFDoc_GraphNode)::DownCast(anAttrSeq.Value( j ));
+          Handle(XCAFDoc_GraphNode) aSHUO =
+            Handle(XCAFDoc_GraphNode)::DownCast(anAttrSeq.Value(j));
           // take label of SHUO
           TDF_Label aSHUOlab = aSHUO->Label();
           TDF_LabelSequence aUpLabels;
           // check is it SHUO of upper_usage
-          CTool->ShapeTool()->GetSHUOUpperUsage( aSHUOlab, aUpLabels );
-          if ( aUpLabels.Length() > 0 )
+          CTool->ShapeTool()->GetSHUOUpperUsage(aSHUOlab, aUpLabels);
+          if (aUpLabels.Length() > 0)
             continue; // transfer only main SHUO
-          if ( aMapOfMainSHUO.Contains( aSHUO ) )
+          if (aMapOfMainSHUO.Contains(aSHUO))
             continue; // do not try to transfer SHUO twice
-          aMapOfMainSHUO.Add( aSHUO );
+          aMapOfMainSHUO.Add(aSHUO);
           // check if it is styled SHUO
           XCAFPrs_Style SHUOstyle;
-          if ( !getSHUOstyle ( aSHUOlab, CTool, SHUOstyle ) ) {
+          if (!getSHUOstyle(aSHUOlab, CTool, SHUOstyle)) {
 #ifdef OCCT_DEBUG
             cout << "Warning: " << __FILE__ << ": do not store SHUO without any style to the STEP model" << endl;
 #endif
             continue;
-          }
+        }
           // write SHUO to the model amd then add structure type.
           TopoDS_Shape NAUOShape; // shape of the deepest NAUO in the SHUO structure
           Standard_Boolean isDeepest = Standard_False;
           Handle(StepRepr_SpecifiedHigherUsageOccurrence) anEntOfSHUO;
           Handle(StepBasic_ProductDefinition) aRelatingPD;
           // create the top SHUO and all other.
-          writeSHUO( aSHUO, CTool->ShapeTool(), WS, anEntOfSHUO, NAUOShape, aRelatingPD, isDeepest );
-          if ( anEntOfSHUO.IsNull() || NAUOShape.IsNull() ) {
+          writeSHUO(aSHUO, CTool->ShapeTool(), WS, anEntOfSHUO, NAUOShape, aRelatingPD, isDeepest);
+          if (anEntOfSHUO.IsNull() || NAUOShape.IsNull()) {
 #ifdef OCCT_DEBUG
             cout << "Warning: " << __FILE__ << ": Cannot store SHUO" << endl;
 #endif
@@ -2037,24 +2062,24 @@ Standard_Boolean STEPCAFControl_Writer::WriteSHUOs (const Handle(XSControl_WorkS
           }
           // create new Product Definition Shape for TOP SHUO
 #ifdef OCCT_DEBUG
-            cout << "Info: " << __FILE__ << ": Create NEW PDS for current SHUO " << endl;
+          cout << "Info: " << __FILE__ << ": Create NEW PDS for current SHUO " << endl;
 #endif
           Handle(StepRepr_ProductDefinitionShape) PDS = new StepRepr_ProductDefinitionShape;
           Handle(TCollection_HAsciiString) aPDSname = new TCollection_HAsciiString("SHUO");
           Handle(TCollection_HAsciiString) descrStr = new TCollection_HAsciiString("");
           StepRepr_CharacterizedDefinition aCharDef;
-          aCharDef.SetValue( anEntOfSHUO );
-          PDS->Init( aPDSname, Standard_False, descrStr, aCharDef );
-          
+          aCharDef.SetValue(anEntOfSHUO);
+          PDS->Init(aPDSname, Standard_False, descrStr, aCharDef);
+
           // create styled item for SHUO and add to the model
-          createSHUOStyledItem ( SHUOstyle, PDS, WS, NAUOShape, CTool->ShapeTool(), myMapCompMDGPR );
-          
-        } // end work with SHUO
-      } // end of an assembly components
-    } // end of IsAssembly case
-    // nothing to do if it is not assembly
+          createSHUOStyledItem(SHUOstyle, PDS, WS, NAUOShape, CTool->ShapeTool(), myMapCompMDGPR);
+
+      } // end work with SHUO
+    } // end of an assembly components
+  } // end of IsAssembly case
+  // nothing to do if it is not assembly
     continue;
-  } // end of iterates on indicated labels
+} // end of iterates on indicated labels
   return Standard_True;
 }
 
@@ -2065,72 +2090,72 @@ Standard_Boolean STEPCAFControl_Writer::WriteSHUOs (const Handle(XSControl_WorkS
 //                     needed ShapeAspect in D&GT structure
 //=======================================================================
 static Standard_Boolean FindPDSforDGT(const Interface_Graph &aGraph,
-                                      const Handle(Standard_Transient) &ent,
-                                      Handle(StepRepr_ProductDefinitionShape) &PDS,
-                                      Handle(StepRepr_RepresentationContext) &RC,
-                                      Handle(StepShape_AdvancedFace) &AF,
-                                      Handle(StepShape_EdgeCurve) &EC)
+  const Handle(Standard_Transient) &ent,
+  Handle(StepRepr_ProductDefinitionShape) &PDS,
+  Handle(StepRepr_RepresentationContext) &RC,
+  Handle(StepShape_AdvancedFace) &AF,
+  Handle(StepShape_EdgeCurve) &EC)
 {
   if (ent.IsNull())
     return Standard_False;
-  if( !ent->IsKind(STANDARD_TYPE(StepShape_EdgeCurve)) && 
-      !ent->IsKind(STANDARD_TYPE(StepShape_AdvancedFace)) ) 
+  if (!ent->IsKind(STANDARD_TYPE(StepShape_EdgeCurve)) &&
+    !ent->IsKind(STANDARD_TYPE(StepShape_AdvancedFace)))
     return Standard_False;
 
   AF = Handle(StepShape_AdvancedFace)::DownCast(ent);
-  if( AF.IsNull() ) {
+  if (AF.IsNull()) {
     EC = Handle(StepShape_EdgeCurve)::DownCast(ent);
     Interface_EntityIterator subs = aGraph.Sharings(EC);
-    for(subs.Start(); subs.More() && AF.IsNull(); subs.Next()) {
+    for (subs.Start(); subs.More() && AF.IsNull(); subs.Next()) {
       Handle(StepShape_OrientedEdge) OE = Handle(StepShape_OrientedEdge)::DownCast(subs.Value());
-      if(OE.IsNull()) continue;
+      if (OE.IsNull()) continue;
       Interface_EntityIterator subs1 = aGraph.Sharings(OE);
-      for(subs1.Start(); subs1.More() && AF.IsNull(); subs1.Next()) {
+      for (subs1.Start(); subs1.More() && AF.IsNull(); subs1.Next()) {
         Handle(StepShape_EdgeLoop) EL = Handle(StepShape_EdgeLoop)::DownCast(subs1.Value());
-        if(EL.IsNull()) continue;
+        if (EL.IsNull()) continue;
         Interface_EntityIterator subs2 = aGraph.Sharings(EL);
-        for(subs2.Start(); subs2.More() && AF.IsNull(); subs2.Next()) {
+        for (subs2.Start(); subs2.More() && AF.IsNull(); subs2.Next()) {
           Handle(StepShape_FaceBound) FB = Handle(StepShape_FaceBound)::DownCast(subs2.Value());
-          if(FB.IsNull()) continue;
+          if (FB.IsNull()) continue;
           Interface_EntityIterator subs3 = aGraph.Sharings(FB);
-          for(subs3.Start(); subs3.More() && AF.IsNull(); subs3.Next()) {
+          for (subs3.Start(); subs3.More() && AF.IsNull(); subs3.Next()) {
             AF = Handle(StepShape_AdvancedFace)::DownCast(subs3.Value());
           }
         }
       }
     }
   }
-  if(AF.IsNull()) return Standard_False;
+  if (AF.IsNull()) return Standard_False;
 
   Interface_EntityIterator subs = aGraph.Sharings(AF);
-  for(subs.Start(); subs.More() && PDS.IsNull(); subs.Next()) {
+  for (subs.Start(); subs.More() && PDS.IsNull(); subs.Next()) {
     Handle(StepShape_ConnectedFaceSet) CFS =
       Handle(StepShape_ConnectedFaceSet)::DownCast(subs.Value());
-    if(CFS.IsNull()) continue;
+    if (CFS.IsNull()) continue;
     Interface_EntityIterator subs1 = aGraph.Sharings(CFS);
-    for(subs1.Start(); subs1.More() && PDS.IsNull(); subs1.Next()) {
-      Handle(StepRepr_RepresentationItem) RI = 
+    for (subs1.Start(); subs1.More() && PDS.IsNull(); subs1.Next()) {
+      Handle(StepRepr_RepresentationItem) RI =
         Handle(StepRepr_RepresentationItem)::DownCast(subs1.Value());
-      if(RI.IsNull()) continue;
+      if (RI.IsNull()) continue;
       Interface_EntityIterator subs2 = aGraph.Sharings(RI);
-      for(subs2.Start(); subs2.More() && PDS.IsNull(); subs2.Next()) {
-        Handle(StepShape_ShapeRepresentation) SR = 
+      for (subs2.Start(); subs2.More() && PDS.IsNull(); subs2.Next()) {
+        Handle(StepShape_ShapeRepresentation) SR =
           Handle(StepShape_ShapeRepresentation)::DownCast(subs2.Value());
-        if(SR.IsNull()) continue;
+        if (SR.IsNull()) continue;
         RC = SR->ContextOfItems();
         Interface_EntityIterator subs3 = aGraph.Sharings(SR);
-        for(subs3.Start(); subs3.More() && PDS.IsNull(); subs3.Next()) {
-          Handle(StepShape_ShapeDefinitionRepresentation) SDR = 
+        for (subs3.Start(); subs3.More() && PDS.IsNull(); subs3.Next()) {
+          Handle(StepShape_ShapeDefinitionRepresentation) SDR =
             Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(subs3.Value());
-          if(SDR.IsNull()) continue;
+          if (SDR.IsNull()) continue;
           Handle(StepRepr_PropertyDefinition) PropD = SDR->Definition().PropertyDefinition();
-          if(PropD.IsNull()) continue;
+          if (PropD.IsNull()) continue;
           PDS = Handle(StepRepr_ProductDefinitionShape)::DownCast(PropD);
         }
       }
     }
   }
-  
+
   return Standard_True;
 }
 
@@ -2139,8 +2164,8 @@ static Standard_Boolean FindPDSforDGT(const Interface_Graph &aGraph,
 //purpose  : auxilary: find Product_definition_shape entity for given entity
 //=======================================================================
 static Handle(StepRepr_ProductDefinitionShape) FindPDS(const Interface_Graph &theGraph,
-                                                       const Handle(Standard_Transient) &theEnt,
-                                                       Handle(StepRepr_RepresentationContext) &theRC)
+  const Handle(Standard_Transient) &theEnt,
+  Handle(StepRepr_RepresentationContext) &theRC)
 {
   if (theEnt.IsNull())
     return NULL;
@@ -2185,34 +2210,34 @@ static Handle(StepRepr_ProductDefinitionShape) FindPDS(const Interface_Graph &th
 //purpose  : auxiliary
 //=======================================================================
 static StepBasic_Unit GetUnit(const Handle(StepRepr_RepresentationContext)& theRC,
-                              const Standard_Boolean isAngle = Standard_False)
+  const Standard_Boolean isAngle = Standard_False)
 {
   StepBasic_Unit aUnit;
   if (isAngle) {
     Handle(StepBasic_SiUnitAndPlaneAngleUnit) aSiPAU;
     Handle(StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext) aCtx =
       Handle(StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext)::DownCast(theRC);
-    if(!aCtx.IsNull()) {
-      for(Standard_Integer j = 1; j <= aCtx->NbUnits(); j++) {
-        if(aCtx->UnitsValue(j)->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndPlaneAngleUnit))) {
+    if (!aCtx.IsNull()) {
+      for (Standard_Integer j = 1; j <= aCtx->NbUnits(); j++) {
+        if (aCtx->UnitsValue(j)->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndPlaneAngleUnit))) {
           aSiPAU = Handle(StepBasic_SiUnitAndPlaneAngleUnit)::DownCast(aCtx->UnitsValue(j));
           break;
         }
       }
     }
-    if(aSiPAU.IsNull()) {
+    if (aSiPAU.IsNull()) {
       Handle(StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx) aCtx1 =
         Handle(StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx)::DownCast(theRC);
-      if(!aCtx1.IsNull()) {
-        for(Standard_Integer j = 1; j <= aCtx1->NbUnits(); j++) {
-          if(aCtx1->UnitsValue(j)->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndPlaneAngleUnit))) {
+      if (!aCtx1.IsNull()) {
+        for (Standard_Integer j = 1; j <= aCtx1->NbUnits(); j++) {
+          if (aCtx1->UnitsValue(j)->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndPlaneAngleUnit))) {
             aSiPAU = Handle(StepBasic_SiUnitAndPlaneAngleUnit)::DownCast(aCtx1->UnitsValue(j));
             break;
           }
         }
       }
     }
-    if(aSiPAU.IsNull())
+    if (aSiPAU.IsNull())
       aSiPAU = new StepBasic_SiUnitAndPlaneAngleUnit;
     aUnit.SetValue(aSiPAU);
   }
@@ -2220,27 +2245,27 @@ static StepBasic_Unit GetUnit(const Handle(StepRepr_RepresentationContext)& theR
     Handle(StepBasic_SiUnitAndLengthUnit) aSiLU;
     Handle(StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext) aCtx =
       Handle(StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext)::DownCast(theRC);
-    if(!aCtx.IsNull()) {
-      for(Standard_Integer j = 1; j <= aCtx->NbUnits(); j++) {
-        if(aCtx->UnitsValue(j)->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndLengthUnit))) {
+    if (!aCtx.IsNull()) {
+      for (Standard_Integer j = 1; j <= aCtx->NbUnits(); j++) {
+        if (aCtx->UnitsValue(j)->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndLengthUnit))) {
           aSiLU = Handle(StepBasic_SiUnitAndLengthUnit)::DownCast(aCtx->UnitsValue(j));
           break;
         }
       }
     }
-    if(aSiLU.IsNull()) {
+    if (aSiLU.IsNull()) {
       Handle(StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx) aCtx1 =
         Handle(StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx)::DownCast(theRC);
-      if(!aCtx1.IsNull()) {
-        for(Standard_Integer j = 1; j <= aCtx1->NbUnits(); j++) {
-          if(aCtx1->UnitsValue(j)->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndLengthUnit))) {
+      if (!aCtx1.IsNull()) {
+        for (Standard_Integer j = 1; j <= aCtx1->NbUnits(); j++) {
+          if (aCtx1->UnitsValue(j)->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndLengthUnit))) {
             aSiLU = Handle(StepBasic_SiUnitAndLengthUnit)::DownCast(aCtx1->UnitsValue(j));
             break;
           }
         }
       }
     }
-    if(aSiLU.IsNull())
+    if (aSiLU.IsNull())
       aSiLU = new StepBasic_SiUnitAndLengthUnit;
     aUnit.SetValue(aSiLU);
   }
@@ -2252,12 +2277,12 @@ static StepBasic_Unit GetUnit(const Handle(StepRepr_RepresentationContext)& theR
 //purpose  : auxiliary
 //======================================================================
 static Handle(StepRepr_ReprItemAndMeasureWithUnit) CreateDimValue(const Standard_Real theValue,
-                                                                  const StepBasic_Unit theUnit,
-                                                                  const Handle(TCollection_HAsciiString)& theName,
-                                                                  const Standard_CString theMeasureName,
-                                                                  const Standard_Boolean isAngle,
-                                                                  const Standard_Boolean isQualified = Standard_False,
-                                                                  const Handle(StepShape_QualifiedRepresentationItem)& theQRI = NULL)
+  const StepBasic_Unit theUnit,
+  const Handle(TCollection_HAsciiString)& theName,
+  const Standard_CString theMeasureName,
+  const Standard_Boolean isAngle,
+  const Standard_Boolean isQualified = Standard_False,
+  const Handle(StepShape_QualifiedRepresentationItem)& theQRI = NULL)
 {
   Handle(StepRepr_RepresentationItem) aReprItem = new StepRepr_RepresentationItem();
   aReprItem->Init(new TCollection_HAsciiString(theName));
@@ -2269,14 +2294,14 @@ static Handle(StepRepr_ReprItemAndMeasureWithUnit) CreateDimValue(const Standard
   if (isQualified) {
     if (isAngle) {
       // Angle & with qualifiers
-      Handle(StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI) anItem = 
+      Handle(StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI) anItem =
         new StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI();
       anItem->Init(aMWU, aReprItem, theQRI);
       return anItem;
     }
     else {
       // Length & with qualifiers
-      Handle(StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI) anItem = 
+      Handle(StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI) anItem =
         new StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI();
       anItem->Init(aMWU, aReprItem, theQRI);
       return anItem;
@@ -2285,14 +2310,14 @@ static Handle(StepRepr_ReprItemAndMeasureWithUnit) CreateDimValue(const Standard
   else {
     if (isAngle) {
       // Angle & without qualifiers
-      Handle(StepRepr_ReprItemAndPlaneAngleMeasureWithUnit) anItem = 
+      Handle(StepRepr_ReprItemAndPlaneAngleMeasureWithUnit) anItem =
         new StepRepr_ReprItemAndPlaneAngleMeasureWithUnit();
       anItem->Init(aMWU, aReprItem);
       return anItem;
     }
     else {
       // Length & without qualifiers
-      Handle(StepRepr_ReprItemAndLengthMeasureWithUnit) anItem = 
+      Handle(StepRepr_ReprItemAndLengthMeasureWithUnit) anItem =
         new StepRepr_ReprItemAndLengthMeasureWithUnit();
       anItem->Init(aMWU, aReprItem);
       return anItem;
@@ -2305,11 +2330,11 @@ static Handle(StepRepr_ReprItemAndMeasureWithUnit) CreateDimValue(const Standard
 //purpose  : auxiliary (write Shape_Aspect entity for given shape)
 //=======================================================================
 
-Handle(StepRepr_ShapeAspect) STEPCAFControl_Writer::WriteShapeAspect (const Handle(XSControl_WorkSession) &WS,
-                                                                      const TDF_Label theLabel,
-                                                                      const TopoDS_Shape theShape,
-                                                                      Handle(StepRepr_RepresentationContext)& theRC,
-                                                                      Handle(StepAP242_GeometricItemSpecificUsage)& theGISU)
+Handle(StepRepr_ShapeAspect) STEPCAFControl_Writer::WriteShapeAspect(const Handle(XSControl_WorkSession) &WS,
+  const TDF_Label theLabel,
+  const TopoDS_Shape theShape,
+  Handle(StepRepr_RepresentationContext)& theRC,
+  Handle(StepAP242_GeometricItemSpecificUsage)& theGISU)
 {
   // Get working data
   const Handle(Interface_InterfaceModel) &Model = WS->Model();
@@ -2322,9 +2347,9 @@ Handle(StepRepr_ShapeAspect) STEPCAFControl_Writer::WriteShapeAspect (const Hand
 
   TopLoc_Location aLoc;
   TColStd_SequenceOfTransient aSeqRI;
-  FindEntities( FP, theShape, aLoc, aSeqRI );
-  if ( aSeqRI.Length() <= 0 ) {
-    FP->Messenger() << "Warning: Cannot find RI for "<<theShape.TShape()->DynamicType()->Name()<<endl;
+  FindEntities(FP, theShape, aLoc, aSeqRI);
+  if (aSeqRI.Length() <= 0) {
+    FP->Messenger() << "Warning: Cannot find RI for " << theShape.TShape()->DynamicType()->Name() << endl;
     return NULL;
   }
 
@@ -2332,7 +2357,7 @@ Handle(StepRepr_ShapeAspect) STEPCAFControl_Writer::WriteShapeAspect (const Hand
   Handle(StepRepr_RepresentationContext) aRC;
   Handle(Standard_Transient) anEnt = aSeqRI.Value(1);
   aPDS = FindPDS(aGraph, anEnt, aRC);
-  if(aPDS.IsNull()) 
+  if (aPDS.IsNull())
     return NULL;
 
   theRC = aRC;
@@ -2380,13 +2405,13 @@ Handle(StepRepr_ShapeAspect) STEPCAFControl_Writer::WriteShapeAspect (const Hand
 //purpose  : auxiliary (write annotation plane and presentation)
 //======================================================================
 void STEPCAFControl_Writer::WritePresentation(const Handle(XSControl_WorkSession) &WS,
-                                              const TopoDS_Shape thePresentation,
-                                              const Handle(TCollection_HAsciiString)& thePrsName,
-                                              const Standard_Boolean hasSemantic,
-                                              const Standard_Boolean hasPlane,
-                                              const gp_Ax2 theAnnotationPlane,
-                                              const gp_Pnt theTextPosition,
-                                              const Handle(Standard_Transient) theDimension)
+  const TopoDS_Shape thePresentation,
+  const Handle(TCollection_HAsciiString)& thePrsName,
+  const Standard_Boolean hasSemantic,
+  const Standard_Boolean hasPlane,
+  const gp_Ax2 theAnnotationPlane,
+  const gp_Pnt theTextPosition,
+  const Handle(Standard_Transient) theDimension)
 {
   if (thePresentation.IsNull())
     return;
@@ -2466,10 +2491,10 @@ void STEPCAFControl_Writer::WritePresentation(const Handle(XSControl_WorkSession
 //           in case of multiple features association)
 //=======================================================================
 Handle(StepDimTol_Datum) STEPCAFControl_Writer::WriteDatumAP242(const Handle(XSControl_WorkSession) &WS,
-                                                                const TDF_LabelSequence theShapeL,
-                                                                const TDF_Label theDatumL,
-                                                                const Standard_Boolean isFirstDTarget,
-                                                                const Handle(StepDimTol_Datum) theWrittenDatum)
+  const TDF_LabelSequence theShapeL,
+  const TDF_Label theDatumL,
+  const Standard_Boolean isFirstDTarget,
+  const Handle(StepDimTol_Datum) theWrittenDatum)
 {
   // Get working data
   const Handle(Interface_InterfaceModel) &Model = WS->Model();
@@ -2528,14 +2553,14 @@ Handle(StepDimTol_Datum) STEPCAFControl_Writer::WriteDatumAP242(const Handle(XSC
 
   // Find if datum has datum targets and get common datum attributes
   Handle(XCAFDoc_Datum) aDatumAttr;
-  if (!theDatumL.FindAttribute(XCAFDoc_Datum::GetID(), aDatumAttr)) 
+  if (!theDatumL.FindAttribute(XCAFDoc_Datum::GetID(), aDatumAttr))
     return NULL;
   Handle(XCAFDimTolObjects_DatumObject) anObject = aDatumAttr->GetObject();
   if (anObject.IsNull())
     return NULL;
   Standard_Boolean isSimpleDatum = !anObject->IsDatumTarget();
   Handle(TCollection_HAsciiString) anIdentifier = anObject->GetName();
-  Handle(TCollection_HAsciiString) aTargetId = (anObject->GetDatumTargetNumber() == 0 ? 
+  Handle(TCollection_HAsciiString) aTargetId = (anObject->GetDatumTargetNumber() == 0 ?
     new TCollection_HAsciiString() : new TCollection_HAsciiString(anObject->GetDatumTargetNumber()));
 
   // If datum type is area, but there is no area in object, write as simple datum
@@ -2619,7 +2644,7 @@ Handle(StepDimTol_Datum) STEPCAFControl_Writer::WriteDatumAP242(const Handle(XSC
         if (aDatumType == XCAFDimTolObjects_DatumTargetType_Point) {
           anItems = new StepRepr_HArray1OfRepresentationItem(1, 1);
         }
-        else  {
+        else {
           Handle(TCollection_HAsciiString) aTargetValueName;
           if (aDatumType == XCAFDimTolObjects_DatumTargetType_Line) {
             anItems = new StepRepr_HArray1OfRepresentationItem(1, 2);
@@ -2706,16 +2731,16 @@ Handle(StepDimTol_Datum) STEPCAFControl_Writer::WriteDatumAP242(const Handle(XSC
 //           qualifiers, modifiers, orientation and tolerance class)
 //======================================================================
 static void WriteDimValues(const Handle(XSControl_WorkSession) &WS,
-                           const Handle(XCAFDimTolObjects_DimensionObject) theObject,
-                           const Handle(StepRepr_RepresentationContext) theRC,
-                           const StepShape_DimensionalCharacteristic theDimension)
+  const Handle(XCAFDimTolObjects_DimensionObject) theObject,
+  const Handle(StepRepr_RepresentationContext) theRC,
+  const StepShape_DimensionalCharacteristic theDimension)
 {
   // Get working data
   const Handle(Interface_InterfaceModel) &aModel = WS->Model();
   XCAFDimTolObjects_DimensionModifiersSequence aModifiers = theObject->GetModifiers();
   Handle(Standard_Transient) aDim = theDimension.Value();
   Standard_Boolean isAngle = aDim->IsKind(STANDARD_TYPE(StepShape_AngularLocation)) ||
-                             aDim->IsKind(STANDARD_TYPE(StepShape_AngularSize));
+    aDim->IsKind(STANDARD_TYPE(StepShape_AngularSize));
 
   // Unit
   StepBasic_Unit aUnit = GetUnit(theRC, isAngle);
@@ -2803,11 +2828,11 @@ static void WriteDimValues(const Handle(XSControl_WorkSession) &WS,
   // Modifiers
   if (aModifiers.Length() > 0) {
     Handle(StepRepr_CompoundRepresentationItem) aCompoundRI = new StepRepr_CompoundRepresentationItem();
-    Handle (StepRepr_HArray1OfRepresentationItem) aModifItems = 
+    Handle(StepRepr_HArray1OfRepresentationItem) aModifItems =
       new StepRepr_HArray1OfRepresentationItem(1, aModifiers.Length());
     for (Standard_Integer i = 1; i <= aModifiers.Length(); i++) {
       XCAFDimTolObjects_DimensionModif aModif = aModifiers.Value(i);
-      Handle(StepRepr_DescriptiveRepresentationItem) aModifItem = 
+      Handle(StepRepr_DescriptiveRepresentationItem) aModifItem =
         new StepRepr_DescriptiveRepresentationItem();
       aModifItem->Init(new TCollection_HAsciiString(), STEPCAFControl_GDTProperty::GetDimModifierName(aModif));
       aModel->AddWithRefs(aModifItem);
@@ -2863,7 +2888,7 @@ static void WriteDimValues(const Handle(XSControl_WorkSession) &WS,
     aDummyName = aDummyName->SubString(9, aDummyName->Length()); //delete "POSITIVE_"
     aMeasureName = aDummyName->ToCString();
     Standard_Real aLowerTolValue = -theObject->GetLowerTolValue(),
-                  anUpperTolValue = theObject->GetUpperTolValue();
+      anUpperTolValue = theObject->GetUpperTolValue();
     // Upper
     Handle(StepBasic_MeasureWithUnit) anUpperMWU = new StepBasic_MeasureWithUnit();
     Handle(StepBasic_MeasureValueMember) anUpperValue = new StepBasic_MeasureValueMember();
@@ -2909,12 +2934,12 @@ static void WriteDimValues(const Handle(XSControl_WorkSession) &WS,
 //function : WriteDerivedGeometry
 //purpose  : auxiliary (write connection point for dimensions)
 //======================================================================
-static void WriteDerivedGeometry (const Handle(XSControl_WorkSession) &WS,
-                                  const Handle(XCAFDimTolObjects_DimensionObject)& theObject,
-                                  const Handle(StepRepr_ConstructiveGeometryRepresentation) theRepr,
-                                  Handle(StepRepr_ShapeAspect)& theFirstSA,
-                                  Handle(StepRepr_ShapeAspect)& theSecondSA,
-                                  NCollection_Vector<Handle(StepGeom_CartesianPoint)>& thePnts)
+static void WriteDerivedGeometry(const Handle(XSControl_WorkSession) &WS,
+  const Handle(XCAFDimTolObjects_DimensionObject)& theObject,
+  const Handle(StepRepr_ConstructiveGeometryRepresentation) theRepr,
+  Handle(StepRepr_ShapeAspect)& theFirstSA,
+  Handle(StepRepr_ShapeAspect)& theSecondSA,
+  NCollection_Vector<Handle(StepGeom_CartesianPoint)>& thePnts)
 {
   const Handle(Interface_InterfaceModel) &aModel = WS->Model();
   // First point
@@ -2936,7 +2961,7 @@ static void WriteDerivedGeometry (const Handle(XSControl_WorkSession) &WS,
     aModel->AddWithRefs(aGISU);
     aModel->AddWithRefs(aSADR);
   }
-  
+
   // Second point (for locations)
   if (theObject->HasPoint2()) {
     GeomToStep_MakeCartesianPoint aPointMaker(theObject->GetPoint2());
@@ -2964,10 +2989,10 @@ static void WriteDerivedGeometry (const Handle(XSControl_WorkSession) &WS,
 //           geometric_tolerance)
 //======================================================================
 static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const Handle(XSControl_WorkSession) &WS,
-                                                                           const TDF_Label theGeomTolL,
-                                                                           const TDF_LabelSequence theDatumSeq,
-                                                                           const STEPConstruct_DataMapOfAsciiStringTransient theDatumMap,
-                                                                           const Handle(StepRepr_RepresentationContext)& theRC)
+  const TDF_Label theGeomTolL,
+  const TDF_LabelSequence theDatumSeq,
+  const STEPConstruct_DataMapOfAsciiStringTransient theDatumMap,
+  const Handle(StepRepr_RepresentationContext)& theRC)
 {
   // Get working data
   const Handle(Interface_InterfaceModel) &Model = WS->Model();
@@ -2976,7 +3001,7 @@ static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const
     return NULL;
   Interface_Graph aGraph = aHGraph->Graph();
   Handle(XCAFDoc_GeomTolerance) aGTAttr;
-  if (!theGeomTolL.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGTAttr)) 
+  if (!theGeomTolL.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGTAttr))
     return NULL;
   Handle(XCAFDimTolObjects_GeomToleranceObject) anObject = aGTAttr->GetObject();
   if (anObject.IsNull())
@@ -2989,7 +3014,7 @@ static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const
   Standard_Integer aMaxDatumNum = 0;
   for (Standard_Integer i = 1; i <= theDatumSeq.Length(); i++) {
     Handle(XCAFDoc_Datum) aDatumAttr;
-    if (!theDatumSeq.Value(i).FindAttribute(XCAFDoc_Datum::GetID(), aDatumAttr)) 
+    if (!theDatumSeq.Value(i).FindAttribute(XCAFDoc_Datum::GetID(), aDatumAttr))
       continue;
     Handle(XCAFDimTolObjects_DatumObject) aDatumObj = aDatumAttr->GetObject();
     if (aDatumObj.IsNull())
@@ -3024,7 +3049,7 @@ static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const
       // Datum entity
       Handle(Standard_Transient) aFDValue;
       if (theDatumMap.Find(aDatumSeqPos.Value(1)->GetName()->String(), aFDValue) && !aFDValue.IsNull())
-        aFirstDatum = Handle(StepDimTol_Datum)::DownCast (aFDValue);
+        aFirstDatum = Handle(StepDimTol_Datum)::DownCast(aFDValue);
       aDatumRef.SetValue(aFirstDatum);
       // Modifiers
       XCAFDimTolObjects_DatumModifiersSequence aSimpleModifiers = aDatumSeqPos.Value(1)->GetModifiers();
@@ -3034,7 +3059,7 @@ static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const
       aModifiers = STEPCAFControl_GDTProperty::GetDatumRefModifiers(aSimpleModifiers, aModifWithVal, aValue, aUnit);
       // Add Datum_Reference_Modifier_With_Value
       if (!aModifiers.IsNull()) {
-        Handle(StepDimTol_DatumReferenceModifierWithValue) aDRMWV = 
+        Handle(StepDimTol_DatumReferenceModifierWithValue) aDRMWV =
           aModifiers->Value(aModifiers->Length()).DatumReferenceModifierWithValue();
         if (!aDRMWV.IsNull()) {
           Model->AddWithRefs(aDRMWV);
@@ -3048,7 +3073,7 @@ static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const
         Handle(StepDimTol_Datum) aDatum;
         Handle(Standard_Transient) aDValue;
         if (theDatumMap.Find(aDatumSeqPos.Value(j)->GetName()->String(), aDValue))
-          aDatum = Handle(StepDimTol_Datum)::DownCast (aDValue);
+          aDatum = Handle(StepDimTol_Datum)::DownCast(aDValue);
         StepDimTol_DatumOrCommonDatum anElemDatumRef;
         anElemDatumRef.SetValue(aDatum);
         if (aFirstDatum.IsNull())
@@ -3062,7 +3087,7 @@ static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const
           STEPCAFControl_GDTProperty::GetDatumRefModifiers(aSimpleModifiers, aModifWithVal, aValue, aUnit);
         // Add Datum_Reference_Modifier_With_Value
         if (!anElemModifiers.IsNull()) {
-          Handle(StepDimTol_DatumReferenceModifierWithValue) aDRMWV = 
+          Handle(StepDimTol_DatumReferenceModifierWithValue) aDRMWV =
             anElemModifiers->Value(anElemModifiers->Length()).DatumReferenceModifierWithValue();
           if (!aDRMWV.IsNull()) {
             Model->AddWithRefs(aDRMWV);
@@ -3125,7 +3150,7 @@ static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const
     }
     if (aSDR.IsNull())
       return aDatumSystem;
-    
+
     aGISU->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(),
       aDefinition, aSDR->UsedRepresentation(), anReprItems);
     Model->AddWithRefs(anAxis);
@@ -3139,10 +3164,10 @@ static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const
 //function : WriteToleranceZone
 //purpose  : auxiliary (write tolerace zones)
 //=======================================================================
-void STEPCAFControl_Writer::WriteToleranceZone (const Handle(XSControl_WorkSession) &WS,
-                                                const Handle(XCAFDimTolObjects_GeomToleranceObject)& theObject,
-                                                const Handle(StepDimTol_GeometricTolerance)& theEntity,
-                                                const Handle(StepRepr_RepresentationContext)& theRC)
+void STEPCAFControl_Writer::WriteToleranceZone(const Handle(XSControl_WorkSession) &WS,
+  const Handle(XCAFDimTolObjects_GeomToleranceObject)& theObject,
+  const Handle(StepDimTol_GeometricTolerance)& theEntity,
+  const Handle(StepRepr_RepresentationContext)& theRC)
 {
   // Get working data
   const Handle(Interface_InterfaceModel) &Model = WS->Model();
@@ -3151,7 +3176,7 @@ void STEPCAFControl_Writer::WriteToleranceZone (const Handle(XSControl_WorkSessi
 
   // Return if there is no tolerance zones
   if (theObject->GetTypeOfValue() == XCAFDimTolObjects_GeomToleranceTypeValue_None &&
-      theObject->GetZoneModifier() != XCAFDimTolObjects_GeomToleranceZoneModif_Runout)
+    theObject->GetZoneModifier() != XCAFDimTolObjects_GeomToleranceZoneModif_Runout)
     return;
 
   // Create Tolerance_Zone
@@ -3188,16 +3213,16 @@ void STEPCAFControl_Writer::WriteToleranceZone (const Handle(XSControl_WorkSessi
 //purpose  : auxiliary (write Geometric_Tolerance entity for given shapes,
 //           label and datum system)
 //======================================================================
-void STEPCAFControl_Writer::WriteGeomTolerance (const Handle(XSControl_WorkSession) &WS,
-                                                const TDF_LabelSequence theShapeSeqL,
-                                                const TDF_Label theGeomTolL,
-                                                const Handle(StepDimTol_HArray1OfDatumSystemOrReference)& theDatumSystem,
-                                                const Handle(StepRepr_RepresentationContext)& theRC)
+void STEPCAFControl_Writer::WriteGeomTolerance(const Handle(XSControl_WorkSession) &WS,
+  const TDF_LabelSequence theShapeSeqL,
+  const TDF_Label theGeomTolL,
+  const Handle(StepDimTol_HArray1OfDatumSystemOrReference)& theDatumSystem,
+  const Handle(StepRepr_RepresentationContext)& theRC)
 {
   // Get working data
   const Handle(Interface_InterfaceModel) &Model = WS->Model();
   Handle(XCAFDoc_GeomTolerance) aGTAttr;
-  if (!theGeomTolL.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGTAttr)) 
+  if (!theGeomTolL.FindAttribute(XCAFDoc_GeomTolerance::GetID(), aGTAttr))
     return;
   Handle(XCAFDimTolObjects_GeomToleranceObject) anObject = aGTAttr->GetObject();
   if (anObject.IsNull())
@@ -3243,8 +3268,8 @@ void STEPCAFControl_Writer::WriteGeomTolerance (const Handle(XSControl_WorkSessi
   aGTTarget.SetValue(aMainSA);
 
   Standard_Boolean isWithModif = Standard_False,
-                   isWithDatRef = Standard_False,
-                   isWithMaxTol = Standard_False;
+    isWithDatRef = Standard_False,
+    isWithMaxTol = Standard_False;
   // Modifiers
   // Simple modifiers
   XCAFDimTolObjects_GeomToleranceModifiersSequence aModifiers = anObject->GetModifiers();
@@ -3252,11 +3277,11 @@ void STEPCAFControl_Writer::WriteGeomTolerance (const Handle(XSControl_WorkSessi
   Handle(StepBasic_LengthMeasureWithUnit) aMaxLMWU;
   Standard_Integer aModifNb = aModifiers.Length();
   if (anObject->GetMaterialRequirementModifier() != XCAFDimTolObjects_GeomToleranceMatReqModif_None)
-      aModifNb++;
+    aModifNb++;
   for (Standard_Integer i = 1; i <= aModifiers.Length(); i++)
     if (aModifiers.Value(i) == XCAFDimTolObjects_GeomToleranceModif_All_Around ||
-        aModifiers.Value(i) == XCAFDimTolObjects_GeomToleranceModif_All_Over)
-        aModifNb--;
+      aModifiers.Value(i) == XCAFDimTolObjects_GeomToleranceModif_All_Over)
+      aModifNb--;
   if (aModifNb > 0) {
     isWithModif = Standard_True;
     aModifArray = new StepDimTol_HArray1OfGeometricToleranceModifier(1, aModifNb);
@@ -3265,7 +3290,7 @@ void STEPCAFControl_Writer::WriteGeomTolerance (const Handle(XSControl_WorkSessi
       if (aModifiers.Value(i) == XCAFDimTolObjects_GeomToleranceModif_All_Around ||
         aModifiers.Value(i) == XCAFDimTolObjects_GeomToleranceModif_All_Over)
         continue;
-      StepDimTol_GeometricToleranceModifier aModif = 
+      StepDimTol_GeometricToleranceModifier aModif =
         STEPCAFControl_GDTProperty::GetGeomToleranceModifier(aModifiers.Value(i));
       aModifArray->SetValue(k, aModif);
       k++;
@@ -3293,14 +3318,14 @@ void STEPCAFControl_Writer::WriteGeomTolerance (const Handle(XSControl_WorkSessi
 
   // Collect all attributes
   Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString(),
-                                  aDescription = new TCollection_HAsciiString();
-  Handle(StepDimTol_GeometricToleranceWithDatumReference) aGTWDR = 
+    aDescription = new TCollection_HAsciiString();
+  Handle(StepDimTol_GeometricToleranceWithDatumReference) aGTWDR =
     new StepDimTol_GeometricToleranceWithDatumReference();
   aGTWDR->SetDatumSystem(theDatumSystem);
-  Handle(StepDimTol_GeometricToleranceWithModifiers) aGTWM = 
+  Handle(StepDimTol_GeometricToleranceWithModifiers) aGTWM =
     new StepDimTol_GeometricToleranceWithModifiers();
   aGTWM->SetModifiers(aModifArray);
-  StepDimTol_GeometricToleranceType aType = 
+  StepDimTol_GeometricToleranceType aType =
     STEPCAFControl_GDTProperty::GetGeomToleranceType(anObject->GetType());
 
   // Init and write necessary subtype of Geometric_Tolerance entity
@@ -3344,13 +3369,13 @@ void STEPCAFControl_Writer::WriteGeomTolerance (const Handle(XSControl_WorkSessi
     if (isWithDatRef) {
       // Geometric_Tolerance & Geometric_Tolerance_With_Datum_Reference
       Handle(StepDimTol_GeoTolAndGeoTolWthDatRef) aResult =
-          new StepDimTol_GeoTolAndGeoTolWthDatRef();
-        aResult->Init(aName, aDescription, aLMWU, aGTTarget, aGTWDR, aType);
-        aGeomTol = aResult;
+        new StepDimTol_GeoTolAndGeoTolWthDatRef();
+      aResult->Init(aName, aDescription, aLMWU, aGTTarget, aGTWDR, aType);
+      aGeomTol = aResult;
     }
     else {
       // Geometric_Tolerance
-      Handle(StepDimTol_GeometricTolerance) aResult = 
+      Handle(StepDimTol_GeometricTolerance) aResult =
         STEPCAFControl_GDTProperty::GetGeomTolerance(anObject->GetType());
       if (!aResult.IsNull()) {
         aResult->Init(aName, aDescription, aLMWU, aGTTarget);
@@ -3369,24 +3394,24 @@ void STEPCAFControl_Writer::WriteGeomTolerance (const Handle(XSControl_WorkSessi
 //function : WriteDGTs
 //purpose  : 
 //=======================================================================
-Standard_Boolean STEPCAFControl_Writer::WriteDGTs (const Handle(XSControl_WorkSession) &WS,
-                                                   const TDF_LabelSequence  &labels ) const
+Standard_Boolean STEPCAFControl_Writer::WriteDGTs(const Handle(XSControl_WorkSession) &WS,
+  const TDF_LabelSequence  &labels) const
 {
-  
-  if ( labels.Length() <=0 ) return Standard_False;
-  
+
+  if (labels.Length() <= 0) return Standard_False;
+
   // get working data
   const Handle(Interface_InterfaceModel) &Model = WS->Model();
   const Handle(XSControl_TransferWriter) &TW = WS->TransferWriter();
   const Handle(Transfer_FinderProcess) &FP = TW->FinderProcess();
 
   const Handle(Interface_HGraph) aHGraph = WS->HGraph();
-  if(aHGraph.IsNull())
+  if (aHGraph.IsNull())
     return Standard_False;
 
   Interface_Graph aGraph = aHGraph->Graph();
-  Handle(XCAFDoc_DimTolTool) DGTTool = XCAFDoc_DocumentTool::DimTolTool( labels(1) );
-  if(DGTTool.IsNull() ) return Standard_False;
+  Handle(XCAFDoc_DimTolTool) DGTTool = XCAFDoc_DocumentTool::DimTolTool(labels(1));
+  if (DGTTool.IsNull()) return Standard_False;
 
   TDF_LabelSequence DGTLabels;
 
@@ -3395,20 +3420,20 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTs (const Handle(XSControl_WorkSe
   // write Datums
   DGTLabels.Clear();
   DGTTool->GetDatumLabels(DGTLabels);
-  if(DGTLabels.Length()<=0) return Standard_False;
+  if (DGTLabels.Length() <= 0) return Standard_False;
   Standard_Integer i;
-  for(i=1; i<=DGTLabels.Length(); i++) {
+  for (i = 1; i <= DGTLabels.Length(); i++) {
     TDF_Label DatumL = DGTLabels.Value(i);
     TDF_LabelSequence ShapeL;
     TDF_LabelSequence aNullSeq;
-    if(!DGTTool->GetRefShapeLabel(DatumL,ShapeL,aNullSeq)) continue;
+    if (!DGTTool->GetRefShapeLabel(DatumL, ShapeL, aNullSeq)) continue;
     // find target shape
     TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(ShapeL.Value(1));
     TopLoc_Location Loc;
     TColStd_SequenceOfTransient seqRI;
-    FindEntities( FP, aShape, Loc, seqRI );
-    if ( seqRI.Length() <= 0 ) {
-      FP->Messenger() << "Warning: Cannot find RI for "<<aShape.TShape()->DynamicType()->Name()<<endl;
+    FindEntities(FP, aShape, Loc, seqRI);
+    if (seqRI.Length() <= 0) {
+      FP->Messenger() << "Warning: Cannot find RI for " << aShape.TShape()->DynamicType()->Name() << endl;
       continue;
     }
     Handle(StepRepr_ProductDefinitionShape) PDS;
@@ -3416,11 +3441,11 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTs (const Handle(XSControl_WorkSe
     Handle(Standard_Transient) ent = seqRI.Value(1);
     Handle(StepShape_AdvancedFace) AF;
     Handle(StepShape_EdgeCurve) EC;
-    FindPDSforDGT(aGraph,ent,PDS,RC,AF,EC);
-    if(PDS.IsNull()) continue;
+    FindPDSforDGT(aGraph, ent, PDS, RC, AF, EC);
+    if (PDS.IsNull()) continue;
     //cout<<"Model->Number(PDS)="<<Model->Number(PDS)<<endl;
     Handle(XCAFDoc_Datum) DatumAttr;
-    if(!DatumL.FindAttribute(XCAFDoc_Datum::GetID(),DatumAttr)) continue;
+    if (!DatumL.FindAttribute(XCAFDoc_Datum::GetID(), DatumAttr)) continue;
     Handle(TCollection_HAsciiString) aName = DatumAttr->GetName();
     Handle(TCollection_HAsciiString) aDescription = DatumAttr->GetDescription();
     Handle(TCollection_HAsciiString) anIdentification = DatumAttr->GetIdentification();
@@ -3439,58 +3464,58 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTs (const Handle(XSControl_WorkSe
     StepRepr_CharacterizedDefinition CD;
     CD.SetValue(DF);
     Handle(StepRepr_PropertyDefinition) PropD = new StepRepr_PropertyDefinition;
-    PropD->Init(aName,Standard_True,aDescription,CD);
+    PropD->Init(aName, Standard_True, aDescription, CD);
     Model->AddWithRefs(PropD);
     StepRepr_RepresentedDefinition RD;
     RD.SetValue(PropD);
     Handle(StepShape_ShapeRepresentation) SR = new StepShape_ShapeRepresentation;
     Handle(StepRepr_HArray1OfRepresentationItem) HARI =
-      new StepRepr_HArray1OfRepresentationItem(1,1);
-    HARI->SetValue(1,AF);
-    SR->Init(aName,HARI,RC);
+      new StepRepr_HArray1OfRepresentationItem(1, 1);
+    HARI->SetValue(1, AF);
+    SR->Init(aName, HARI, RC);
     Handle(StepShape_ShapeDefinitionRepresentation) SDR = new StepShape_ShapeDefinitionRepresentation;
-    SDR->Init(RD,SR);
+    SDR->Init(RD, SR);
     Model->AddWithRefs(SDR);
     // write chain for Datum 
     StepRepr_CharacterizedDefinition CD1;
     CD1.SetValue(aDatum);
     Handle(StepRepr_PropertyDefinition) PropD1 = new StepRepr_PropertyDefinition;
-    PropD1->Init(aName,Standard_True,aDescription,CD1);
+    PropD1->Init(aName, Standard_True, aDescription, CD1);
     Model->AddWithRefs(PropD1);
     StepRepr_RepresentedDefinition RD1;
     RD1.SetValue(PropD1);
     Handle(StepShape_ShapeRepresentation) SR1 = new StepShape_ShapeRepresentation;
     Handle(StepRepr_HArray1OfRepresentationItem) HARI1 =
-      new StepRepr_HArray1OfRepresentationItem(1,1);
-    HARI1->SetValue(1,AF->FaceGeometry());
-    SR1->Init(aName,HARI1,RC);
+      new StepRepr_HArray1OfRepresentationItem(1, 1);
+    HARI1->SetValue(1, AF->FaceGeometry());
+    SR1->Init(aName, HARI1, RC);
     Model->AddWithRefs(SR1);
     Handle(StepShape_ShapeDefinitionRepresentation) SDR1 = new StepShape_ShapeDefinitionRepresentation;
-    SDR1->Init(RD1,SR1);
+    SDR1->Init(RD1, SR1);
     Model->AddWithRefs(SDR1);
     // add created Datum into Map
     TCollection_AsciiString stmp(aName->ToCString());
     stmp.AssignCat(aDescription->ToCString());
     stmp.AssignCat(anIdentification->ToCString());
-    DatumMap.Bind(stmp,aDatum);
+    DatumMap.Bind(stmp, aDatum);
   }
 
   // write Tolerances and Dimensions
   DGTLabels.Clear();
   DGTTool->GetDimTolLabels(DGTLabels);
-  if(DGTLabels.Length()<=0) return Standard_False;
-  for(i=1; i<=DGTLabels.Length(); i++) {
+  if (DGTLabels.Length() <= 0) return Standard_False;
+  for (i = 1; i <= DGTLabels.Length(); i++) {
     TDF_Label DimTolL = DGTLabels.Value(i);
     TDF_LabelSequence ShapeL;
     TDF_LabelSequence aNullSeq;
-    if(!DGTTool->GetRefShapeLabel(DimTolL,ShapeL,aNullSeq)) continue;
+    if (!DGTTool->GetRefShapeLabel(DimTolL, ShapeL, aNullSeq)) continue;
     // find target shape
     TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(ShapeL.Value(1));
     TopLoc_Location Loc;
     TColStd_SequenceOfTransient seqRI;
-    FindEntities( FP, aShape, Loc, seqRI );
-    if ( seqRI.Length() <= 0 ) {
-      FP->Messenger() << "Warning: Cannot find RI for "<<aShape.TShape()->DynamicType()->Name()<<endl;
+    FindEntities(FP, aShape, Loc, seqRI);
+    if (seqRI.Length() <= 0) {
+      FP->Messenger() << "Warning: Cannot find RI for " << aShape.TShape()->DynamicType()->Name() << endl;
       continue;
     }
     Handle(StepRepr_ProductDefinitionShape) PDS;
@@ -3498,12 +3523,12 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTs (const Handle(XSControl_WorkSe
     Handle(Standard_Transient) ent = seqRI.Value(1);
     Handle(StepShape_AdvancedFace) AF;
     Handle(StepShape_EdgeCurve) EC;
-    FindPDSforDGT(aGraph,ent,PDS,RC,AF,EC);
-    if(PDS.IsNull()) continue;
+    FindPDSforDGT(aGraph, ent, PDS, RC, AF, EC);
+    if (PDS.IsNull()) continue;
     //cout<<"Model->Number(PDS)="<<Model->Number(PDS)<<endl;
 
     Handle(XCAFDoc_DimTol) DimTolAttr;
-    if(!DimTolL.FindAttribute(XCAFDoc_DimTol::GetID(),DimTolAttr)) continue;
+    if (!DimTolL.FindAttribute(XCAFDoc_DimTol::GetID(), DimTolAttr)) continue;
     Standard_Integer kind = DimTolAttr->GetKind();
     Handle(TColStd_HArray1OfReal) aVal = DimTolAttr->GetVal();
     Handle(TCollection_HAsciiString) aName = DimTolAttr->GetName();
@@ -3516,78 +3541,78 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTs (const Handle(XSControl_WorkSe
     Model->AddWithRefs(SA);
     CD.SetValue(SA);
     Handle(StepRepr_PropertyDefinition) PropD = new StepRepr_PropertyDefinition;
-    PropD->Init(aName,Standard_True,aDescription,CD);
+    PropD->Init(aName, Standard_True, aDescription, CD);
     Model->AddWithRefs(PropD);
     StepRepr_RepresentedDefinition RD;
     RD.SetValue(PropD);
     Handle(StepShape_ShapeRepresentation) SR = new StepShape_ShapeRepresentation;
     Handle(StepRepr_HArray1OfRepresentationItem) HARI =
-      new StepRepr_HArray1OfRepresentationItem(1,1);
-    if(kind<20) 
-      HARI->SetValue(1,EC);
+      new StepRepr_HArray1OfRepresentationItem(1, 1);
+    if (kind < 20)
+      HARI->SetValue(1, EC);
     else
-      HARI->SetValue(1,AF);
-    SR->Init(aName,HARI,RC);
+      HARI->SetValue(1, AF);
+    SR->Init(aName, HARI, RC);
     Handle(StepShape_ShapeDefinitionRepresentation) SDR = new StepShape_ShapeDefinitionRepresentation;
-    SDR->Init(RD,SR);
+    SDR->Init(RD, SR);
     Model->AddWithRefs(SDR);
     // define aUnit for creation LengthMeasureWithUnit (common for all)
     StepBasic_Unit aUnit;
     Handle(StepBasic_SiUnitAndLengthUnit) SLU;
     Handle(StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext) Ctx =
       Handle(StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext)::DownCast(RC);
-    if(!Ctx.IsNull()) {
-      for(Standard_Integer j=1; j<=Ctx->NbUnits(); j++) {
-        if(Ctx->UnitsValue(j)->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndLengthUnit))) {
+    if (!Ctx.IsNull()) {
+      for (Standard_Integer j = 1; j <= Ctx->NbUnits(); j++) {
+        if (Ctx->UnitsValue(j)->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndLengthUnit))) {
           SLU = Handle(StepBasic_SiUnitAndLengthUnit)::DownCast(Ctx->UnitsValue(j));
           break;
         }
       }
     }
-    if(SLU.IsNull()) {
+    if (SLU.IsNull()) {
       Handle(StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx) Ctx1 =
         Handle(StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx)::DownCast(RC);
-      if(!Ctx1.IsNull()) {
-        for(Standard_Integer j=1; j<=Ctx1->NbUnits(); j++) {
-          if(Ctx1->UnitsValue(j)->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndLengthUnit))) {
+      if (!Ctx1.IsNull()) {
+        for (Standard_Integer j = 1; j <= Ctx1->NbUnits(); j++) {
+          if (Ctx1->UnitsValue(j)->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndLengthUnit))) {
             SLU = Handle(StepBasic_SiUnitAndLengthUnit)::DownCast(Ctx1->UnitsValue(j));
             break;
           }
         }
       }
     }
-    if(SLU.IsNull()) {
+    if (SLU.IsNull()) {
       SLU = new StepBasic_SiUnitAndLengthUnit;
     }
     aUnit.SetValue(SLU);
 
     // specific part of writing D&GT entities
-    if(kind<20) { //dimension
+    if (kind < 20) { //dimension
       Handle(StepShape_DimensionalSize) DimSize = new StepShape_DimensionalSize;
-      DimSize->Init(SA,aDescription);
+      DimSize->Init(SA, aDescription);
       Model->AddWithRefs(DimSize);
-      if(aVal->Length()>1) {
+      if (aVal->Length() > 1) {
         // create MeasureWithUnits
         Handle(StepBasic_MeasureValueMember) MVM1 = new StepBasic_MeasureValueMember;
         MVM1->SetName("POSITIVE_LENGTH_MEASURE");
         MVM1->SetReal(aVal->Value(1));
         Handle(StepBasic_MeasureWithUnit) MWU1 = new StepBasic_MeasureWithUnit;
-        MWU1->Init(MVM1,aUnit);
+        MWU1->Init(MVM1, aUnit);
         Handle(StepBasic_MeasureValueMember) MVM2 = new StepBasic_MeasureValueMember;
         MVM2->SetName("POSITIVE_LENGTH_MEASURE");
         MVM2->SetReal(aVal->Value(2));
         Handle(StepBasic_MeasureWithUnit) MWU2 = new StepBasic_MeasureWithUnit;
-        MWU2->Init(MVM2,aUnit);
+        MWU2->Init(MVM2, aUnit);
         Handle(StepRepr_RepresentationItem) RI1 = new StepRepr_RepresentationItem;
         RI1->Init(new TCollection_HAsciiString("lower limit"));
         Handle(StepRepr_RepresentationItem) RI2 = new StepRepr_RepresentationItem;
         RI2->Init(new TCollection_HAsciiString("upper limit"));
         Handle(StepRepr_ReprItemAndLengthMeasureWithUnit) RILMU1 =
           new StepRepr_ReprItemAndLengthMeasureWithUnit;
-        RILMU1->Init(MWU1,RI1);
+        RILMU1->Init(MWU1, RI1);
         Handle(StepRepr_ReprItemAndLengthMeasureWithUnit) RILMU2 =
           new StepRepr_ReprItemAndLengthMeasureWithUnit;
-        RILMU2->Init(MWU2,RI2);
+        RILMU2->Init(MWU2, RI2);
         Model->AddWithRefs(RILMU1);
         Model->AddWithRefs(RILMU2);
         //Handle(StepRepr_CompoundItemDefinitionMember) CIDM =
@@ -3600,51 +3625,51 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTs (const Handle(XSControl_WorkSe
         //StepRepr_CompoundItemDefinition CID;
         //CID.SetValue(CIDM);
         Handle(StepRepr_HArray1OfRepresentationItem) HARIVR =
-          new StepRepr_HArray1OfRepresentationItem(1,2);
-        HARIVR->SetValue(1,RILMU1);
-        HARIVR->SetValue(2,RILMU2);
+          new StepRepr_HArray1OfRepresentationItem(1, 2);
+        HARIVR->SetValue(1, RILMU1);
+        HARIVR->SetValue(2, RILMU2);
         Handle(StepRepr_ValueRange) VR = new StepRepr_ValueRange;
         //VR->Init(aName,CID);
-        VR->Init(aName,HARIVR);
+        VR->Init(aName, HARIVR);
         Model->AddEntity(VR);
         Handle(StepShape_ShapeDimensionRepresentation) SDimR =
           new StepShape_ShapeDimensionRepresentation;
         Handle(StepRepr_HArray1OfRepresentationItem) aHARI =
-          new StepRepr_HArray1OfRepresentationItem(1,1);
-        aHARI->SetValue(1,VR);
-        SDimR->Init(aName,aHARI,RC);
+          new StepRepr_HArray1OfRepresentationItem(1, 1);
+        aHARI->SetValue(1, VR);
+        SDimR->Init(aName, aHARI, RC);
         Model->AddWithRefs(SDimR);
         Handle(StepShape_DimensionalCharacteristicRepresentation) DimCharR =
           new StepShape_DimensionalCharacteristicRepresentation;
         StepShape_DimensionalCharacteristic DimChar;
         DimChar.SetValue(DimSize);
-        DimCharR->Init(DimChar,SDimR);
+        DimCharR->Init(DimChar, SDimR);
         Model->AddEntity(DimCharR);
       }
     }
-    else if(kind<50) { //tolerance
-      if(kind<35) { // tolerance with datum system
+    else if (kind < 50) { //tolerance
+      if (kind < 35) { // tolerance with datum system
         TDF_LabelSequence DatumLabels;
-        DGTTool->GetDatumOfTolerLabels(DimTolL,DatumLabels);
+        DGTTool->GetDatumOfTolerLabels(DimTolL, DatumLabels);
         Standard_Integer NbDR = DatumLabels.Length();
-        Handle(StepDimTol_HArray1OfDatumReference) HADR = new StepDimTol_HArray1OfDatumReference(1,NbDR);
-        for(Standard_Integer j=1; j<=NbDR; j++) {
+        Handle(StepDimTol_HArray1OfDatumReference) HADR = new StepDimTol_HArray1OfDatumReference(1, NbDR);
+        for (Standard_Integer j = 1; j <= NbDR; j++) {
           Handle(XCAFDoc_Datum) DatumAttr;
           TDF_Label DatumL = DatumLabels.Value(j);
-          if(!DatumL.FindAttribute(XCAFDoc_Datum::GetID(),DatumAttr)) continue;
+          if (!DatumL.FindAttribute(XCAFDoc_Datum::GetID(), DatumAttr)) continue;
           Handle(TCollection_HAsciiString) aNameD = DatumAttr->GetName();
           Handle(TCollection_HAsciiString) aDescriptionD = DatumAttr->GetDescription();
           Handle(TCollection_HAsciiString) anIdentificationD = DatumAttr->GetIdentification();
           TCollection_AsciiString stmp(aNameD->ToCString());
           stmp.AssignCat(aDescriptionD->ToCString());
           stmp.AssignCat(anIdentificationD->ToCString());
-          if(DatumMap.IsBound(stmp)) {
-            Handle(StepDimTol_Datum) aDatum = 
+          if (DatumMap.IsBound(stmp)) {
+            Handle(StepDimTol_Datum) aDatum =
               Handle(StepDimTol_Datum)::DownCast(DatumMap.Find(stmp));
             Handle(StepDimTol_DatumReference) DR = new StepDimTol_DatumReference;
-            DR->Init(j,aDatum);
+            DR->Init(j, aDatum);
             Model->AddWithRefs(DR);
-            HADR->SetValue(j,DR);
+            HADR->SetValue(j, DR);
           }
         }
         // create LengthMeasureWithUnit
@@ -3652,68 +3677,68 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTs (const Handle(XSControl_WorkSe
         MVM->SetName("LENGTH_MEASURE");
         MVM->SetReal(aVal->Value(1));
         Handle(StepBasic_LengthMeasureWithUnit) LMWU = new StepBasic_LengthMeasureWithUnit;
-        LMWU->Init(MVM,aUnit);
+        LMWU->Init(MVM, aUnit);
         // create tolerance by it's type
-        if(kind<24) {
+        if (kind < 24) {
           Handle(StepDimTol_GeometricToleranceWithDatumReference) GTWDR =
             new StepDimTol_GeometricToleranceWithDatumReference;
           GTWDR->SetDatumSystem(HADR);
           Handle(StepDimTol_ModifiedGeometricTolerance) MGT =
             new StepDimTol_ModifiedGeometricTolerance;
-          if(kind==21) MGT->SetModifier(StepDimTol_MaximumMaterialCondition);
-          else if(kind==22) MGT->SetModifier(StepDimTol_LeastMaterialCondition);
-          else if(kind==23) MGT->SetModifier(StepDimTol_RegardlessOfFeatureSize);
+          if (kind == 21) MGT->SetModifier(StepDimTol_MaximumMaterialCondition);
+          else if (kind == 22) MGT->SetModifier(StepDimTol_LeastMaterialCondition);
+          else if (kind == 23) MGT->SetModifier(StepDimTol_RegardlessOfFeatureSize);
           Handle(StepDimTol_GeoTolAndGeoTolWthDatRefAndModGeoTolAndPosTol) GTComplex =
             new StepDimTol_GeoTolAndGeoTolWthDatRefAndModGeoTolAndPosTol;
-          GTComplex->Init(aName,aDescription,LMWU,SA,GTWDR,MGT);
+          GTComplex->Init(aName, aDescription, LMWU, SA, GTWDR, MGT);
           Model->AddWithRefs(GTComplex);
         }
-        else if(kind==24) {
+        else if (kind == 24) {
           Handle(StepDimTol_AngularityTolerance) aToler =
             new StepDimTol_AngularityTolerance;
-          aToler->Init(aName,aDescription,LMWU,SA,HADR);
+          aToler->Init(aName, aDescription, LMWU, SA, HADR);
           Model->AddWithRefs(aToler);
         }
-        else if(kind==25) {
+        else if (kind == 25) {
           Handle(StepDimTol_CircularRunoutTolerance) aToler =
             new StepDimTol_CircularRunoutTolerance;
-          aToler->Init(aName,aDescription,LMWU,SA,HADR);
+          aToler->Init(aName, aDescription, LMWU, SA, HADR);
           Model->AddWithRefs(aToler);
         }
-        else if(kind==26) {
+        else if (kind == 26) {
           Handle(StepDimTol_CoaxialityTolerance) aToler =
             new StepDimTol_CoaxialityTolerance;
-          aToler->Init(aName,aDescription,LMWU,SA,HADR);
+          aToler->Init(aName, aDescription, LMWU, SA, HADR);
           Model->AddWithRefs(aToler);
         }
-        else if(kind==27) {
+        else if (kind == 27) {
           Handle(StepDimTol_ConcentricityTolerance) aToler =
             new StepDimTol_ConcentricityTolerance;
-          aToler->Init(aName,aDescription,LMWU,SA,HADR);
+          aToler->Init(aName, aDescription, LMWU, SA, HADR);
           Model->AddWithRefs(aToler);
         }
-        else if(kind==28) {
+        else if (kind == 28) {
           Handle(StepDimTol_ParallelismTolerance) aToler =
             new StepDimTol_ParallelismTolerance;
-          aToler->Init(aName,aDescription,LMWU,SA,HADR);
+          aToler->Init(aName, aDescription, LMWU, SA, HADR);
           Model->AddWithRefs(aToler);
         }
-        else if(kind==29) {
+        else if (kind == 29) {
           Handle(StepDimTol_PerpendicularityTolerance) aToler =
             new StepDimTol_PerpendicularityTolerance;
-          aToler->Init(aName,aDescription,LMWU,SA,HADR);
+          aToler->Init(aName, aDescription, LMWU, SA, HADR);
           Model->AddWithRefs(aToler);
         }
-        else if(kind==30) {
+        else if (kind == 30) {
           Handle(StepDimTol_SymmetryTolerance) aToler =
             new StepDimTol_SymmetryTolerance;
-          aToler->Init(aName,aDescription,LMWU,SA,HADR);
+          aToler->Init(aName, aDescription, LMWU, SA, HADR);
           Model->AddWithRefs(aToler);
         }
-        else if(kind==31) {
+        else if (kind == 31) {
           Handle(StepDimTol_TotalRunoutTolerance) aToler =
             new StepDimTol_TotalRunoutTolerance;
-          aToler->Init(aName,aDescription,LMWU,SA,HADR);
+          aToler->Init(aName, aDescription, LMWU, SA, HADR);
           Model->AddWithRefs(aToler);
         }
       }
@@ -3728,23 +3753,23 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTs (const Handle(XSControl_WorkSe
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_WorkSession) &WS,
-                                                        const TDF_LabelSequence  &labels )
+Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242(const Handle(XSControl_WorkSession) &WS,
+  const TDF_LabelSequence  &labels)
 {
   // Get working data
   const Handle(Interface_InterfaceModel) &aModel = WS->Model();
 
   const Handle(Interface_HGraph) aHGraph = WS->HGraph();
-  if(aHGraph.IsNull())
+  if (aHGraph.IsNull())
     return Standard_False;
 
   Interface_Graph aGraph = aHGraph->Graph();
   Handle(XCAFDoc_DimTolTool) DGTTool = XCAFDoc_DocumentTool::DimTolTool(labels(1));
-  if(DGTTool.IsNull())
+  if (DGTTool.IsNull())
     return Standard_False;
 
   // Common entities for presentation
-  STEPConstruct_Styles aStyles (WS);
+  STEPConstruct_Styles aStyles(WS);
   Handle(StepVisual_Colour) aCurvColor = aStyles.EncodeColor(Quantity_NOC_WHITE);
   Handle(StepRepr_RepresentationItem) anItem = NULL;
   myGDTPrsCurveStyle->SetValue(1, aStyles.MakeColorPSA(anItem, aCurvColor, aCurvColor));
@@ -3762,7 +3787,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
   DGTTool->GetDatumLabels(aDGTLabels);
   // Find all shapes with datums
   TColStd_MapOfAsciiString aNameIdMap;
-  for(Standard_Integer i = 1; i <= aDGTLabels.Length(); i++) {
+  for (Standard_Integer i = 1; i <= aDGTLabels.Length(); i++) {
     TDF_Label aDatumL = aDGTLabels.Value(i);
     TDF_LabelSequence aShapeL, aNullSeq;
     DGTTool->GetRefShapeLabel(aDatumL, aShapeL, aNullSeq);
@@ -3775,8 +3800,8 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
       continue;
     Handle(Standard_Transient) aWrittenDatum;
     Standard_Boolean isFirstDT = !aDatumMap.Find(aDatumName, aWrittenDatum);
-    Handle(StepDimTol_Datum) aDatum = WriteDatumAP242(WS, aShapeL, aDatumL, isFirstDT, 
-                                                      Handle(StepDimTol_Datum)::DownCast (aWrittenDatum));
+    Handle(StepDimTol_Datum) aDatum = WriteDatumAP242(WS, aShapeL, aDatumL, isFirstDT,
+      Handle(StepDimTol_Datum)::DownCast(aWrittenDatum));
     // Add created Datum into Map
     aDatumMap.Bind(aDatumName, aDatum);
   }
@@ -3798,7 +3823,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
     TDF_Label aDimensionL = aDGTLabels.Value(i);
     TDF_LabelSequence aFirstShapeL, aSecondShapeL;
     Handle(XCAFDoc_Dimension) aDimAttr;
-    if (!aDimensionL.FindAttribute(XCAFDoc_Dimension::GetID(),aDimAttr)) 
+    if (!aDimensionL.FindAttribute(XCAFDoc_Dimension::GetID(), aDimAttr))
       continue;
     Handle(XCAFDimTolObjects_DimensionObject) anObject = aDimAttr->GetObject();
     if (anObject.IsNull())
@@ -3895,11 +3920,11 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
       if (anObject->HasQualifier()) {
         XCAFDimTolObjects_DimensionQualifier aQualifier = anObject->GetQualifier();
         switch (aQualifier) {
-          case XCAFDimTolObjects_DimensionQualifier_Min: aRelator = StepShape_Small;
-            break;
-          case XCAFDimTolObjects_DimensionQualifier_Max: aRelator = StepShape_Large;
-            break;
-          default: aRelator = StepShape_Equal;
+        case XCAFDimTolObjects_DimensionQualifier_Min: aRelator = StepShape_Small;
+          break;
+        case XCAFDimTolObjects_DimensionQualifier_Max: aRelator = StepShape_Large;
+          break;
+        default: aRelator = StepShape_Equal;
         }
       }
       aDim->Init(new TCollection_HAsciiString(), Standard_False, NULL, aFirstSA, aSecondSA, aRelator);
@@ -3925,11 +3950,11 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
       if (anObject->HasQualifier()) {
         XCAFDimTolObjects_DimensionQualifier aQualifier = anObject->GetQualifier();
         switch (aQualifier) {
-          case XCAFDimTolObjects_DimensionQualifier_Min: aRelator = StepShape_Small;
-            break;
-          case XCAFDimTolObjects_DimensionQualifier_Max: aRelator = StepShape_Large;
-            break;
-          default: aRelator = StepShape_Equal;
+        case XCAFDimTolObjects_DimensionQualifier_Min: aRelator = StepShape_Small;
+          break;
+        case XCAFDimTolObjects_DimensionQualifier_Max: aRelator = StepShape_Large;
+          break;
+        default: aRelator = StepShape_Equal;
         }
       }
       aDim->Init(aFirstSA, new TCollection_HAsciiString(), aRelator);
@@ -3997,25 +4022,25 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
 //purpose  : auxilary: 
 //=======================================================================
 static Standard_Boolean FindPDSforRI(const Interface_Graph &aGraph,
-                                     const Handle(Standard_Transient) &ent,
-                                     Handle(StepRepr_ProductDefinitionShape) &PDS,
-                                     Handle(StepRepr_RepresentationContext) &RC)
+  const Handle(Standard_Transient) &ent,
+  Handle(StepRepr_ProductDefinitionShape) &PDS,
+  Handle(StepRepr_RepresentationContext) &RC)
 {
-  if(ent.IsNull() || !ent->IsKind(STANDARD_TYPE(StepRepr_RepresentationItem)))
+  if (ent.IsNull() || !ent->IsKind(STANDARD_TYPE(StepRepr_RepresentationItem)))
     return Standard_False;
   Interface_EntityIterator subs = aGraph.Sharings(ent);
-  for(subs.Start(); subs.More() && PDS.IsNull(); subs.Next()) {
-    Handle(StepShape_ShapeRepresentation) SR = 
+  for (subs.Start(); subs.More() && PDS.IsNull(); subs.Next()) {
+    Handle(StepShape_ShapeRepresentation) SR =
       Handle(StepShape_ShapeRepresentation)::DownCast(subs.Value());
-    if(SR.IsNull()) continue;
+    if (SR.IsNull()) continue;
     RC = SR->ContextOfItems();
     Interface_EntityIterator subs1 = aGraph.Sharings(SR);
-    for(subs1.Start(); subs1.More() && PDS.IsNull(); subs1.Next()) {
-      Handle(StepShape_ShapeDefinitionRepresentation) SDR = 
+    for (subs1.Start(); subs1.More() && PDS.IsNull(); subs1.Next()) {
+      Handle(StepShape_ShapeDefinitionRepresentation) SDR =
         Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(subs1.Value());
-      if(SDR.IsNull()) continue;
+      if (SDR.IsNull()) continue;
       Handle(StepRepr_PropertyDefinition) PropD = SDR->Definition().PropertyDefinition();
-      if(PropD.IsNull()) continue;
+      if (PropD.IsNull()) continue;
       PDS = Handle(StepRepr_ProductDefinitionShape)::DownCast(PropD);
     }
   }
@@ -4028,11 +4053,11 @@ static Standard_Boolean FindPDSforRI(const Interface_Graph &aGraph,
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::WriteMaterials (const Handle(XSControl_WorkSession) &WS,
-                                                        const TDF_LabelSequence  &labels ) const
+Standard_Boolean STEPCAFControl_Writer::WriteMaterials(const Handle(XSControl_WorkSession) &WS,
+  const TDF_LabelSequence  &labels) const
 {
-  
-  if ( labels.Length() <=0 ) return Standard_False;
+
+  if (labels.Length() <= 0) return Standard_False;
 
   // get working data
   const Handle(Interface_InterfaceModel) &Model = WS->Model();
@@ -4040,36 +4065,36 @@ Standard_Boolean STEPCAFControl_Writer::WriteMaterials (const Handle(XSControl_W
   const Handle(Transfer_FinderProcess) &FP = TW->FinderProcess();
 
   const Handle(Interface_HGraph) aHGraph = WS->HGraph();
-  if(aHGraph.IsNull())
+  if (aHGraph.IsNull())
     return Standard_False;
 
   Interface_Graph aGraph = WS->HGraph()->Graph();
-  Handle(XCAFDoc_ShapeTool) ShTool = XCAFDoc_DocumentTool::ShapeTool( labels(1) );
-  if(ShTool.IsNull() ) return Standard_False;
-  Handle(XCAFDoc_MaterialTool) MatTool = XCAFDoc_DocumentTool::MaterialTool( labels(1) );
-  if(MatTool.IsNull() ) return Standard_False;
+  Handle(XCAFDoc_ShapeTool) ShTool = XCAFDoc_DocumentTool::ShapeTool(labels(1));
+  if (ShTool.IsNull()) return Standard_False;
+  Handle(XCAFDoc_MaterialTool) MatTool = XCAFDoc_DocumentTool::MaterialTool(labels(1));
+  if (MatTool.IsNull()) return Standard_False;
 
-  STEPConstruct_DataMapOfAsciiStringTransient MapDRI,MapMRI;
+  STEPConstruct_DataMapOfAsciiStringTransient MapDRI, MapMRI;
   TDF_LabelSequence TopLabels;
   ShTool->GetShapes(TopLabels);
-  for(Standard_Integer i=1; i<=TopLabels.Length(); i++) {
+  for (Standard_Integer i = 1; i <= TopLabels.Length(); i++) {
     TDF_Label ShL = TopLabels.Value(i);
     Handle(TDataStd_TreeNode) Node;
-    if( ShL.FindAttribute(XCAFDoc::MaterialRefGUID(),Node) && Node->HasFather() ) {
+    if (ShL.FindAttribute(XCAFDoc::MaterialRefGUID(), Node) && Node->HasFather()) {
       // find PDS for current shape
       TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(ShL);
       TopLoc_Location Loc;
       TColStd_SequenceOfTransient seqRI;
-      FindEntities( FP, aShape, Loc, seqRI );
-      if(seqRI.Length()<=0) continue;
+      FindEntities(FP, aShape, Loc, seqRI);
+      if (seqRI.Length() <= 0) continue;
       Handle(StepRepr_ProductDefinitionShape) PDS;
       Handle(StepRepr_RepresentationContext) RC;
       Handle(Standard_Transient) ent = seqRI.Value(1);
-      FindPDSforRI(aGraph,ent,PDS,RC);
-      if(PDS.IsNull()) continue;
-      Handle(StepBasic_ProductDefinition) aProdDef = 
+      FindPDSforRI(aGraph, ent, PDS, RC);
+      if (PDS.IsNull()) continue;
+      Handle(StepBasic_ProductDefinition) aProdDef =
         PDS->Definition().ProductDefinition();
-      if(aProdDef.IsNull())
+      if (aProdDef.IsNull())
         continue;
       // write material entities
       TDF_Label MatL = Node->Father()->Label();
@@ -4080,40 +4105,40 @@ Standard_Boolean STEPCAFControl_Writer::WriteMaterials (const Handle(XSControl_W
       Handle(TCollection_HAsciiString) aDensValType;
       Handle(StepRepr_Representation) RepDRI;
       Handle(StepRepr_Representation) RepMRI;
-      if(MatTool->GetMaterial(MatL,aName,aDescription,aDensity,aDensName,aDensValType)) {
-        if(aName->Length()==0) continue;
+      if (MatTool->GetMaterial(MatL, aName, aDescription, aDensity, aDensName, aDensValType)) {
+        if (aName->Length() == 0) continue;
         TCollection_AsciiString aKey(aName->ToCString());
-        if(MapDRI.IsBound(aKey)) {
+        if (MapDRI.IsBound(aKey)) {
           RepDRI = Handle(StepRepr_Representation)::DownCast(MapDRI.Find(aKey));
-          if(MapMRI.IsBound(aKey)) {
+          if (MapMRI.IsBound(aKey)) {
             RepMRI = Handle(StepRepr_Representation)::DownCast(MapMRI.Find(aKey));
           }
         }
         else {
           // write DRI
           Handle(StepRepr_DescriptiveRepresentationItem) DRI = new StepRepr_DescriptiveRepresentationItem;
-          DRI->Init(aName,aDescription);
-          Handle(StepRepr_HArray1OfRepresentationItem) HARI = new StepRepr_HArray1OfRepresentationItem(1,1);
-          HARI->SetValue(1,DRI);
+          DRI->Init(aName, aDescription);
+          Handle(StepRepr_HArray1OfRepresentationItem) HARI = new StepRepr_HArray1OfRepresentationItem(1, 1);
+          HARI->SetValue(1, DRI);
           RepDRI = new StepRepr_Representation();
-          RepDRI->Init(new TCollection_HAsciiString("material name"),HARI,RC);
+          RepDRI->Init(new TCollection_HAsciiString("material name"), HARI, RC);
           Model->AddWithRefs(RepDRI);
           // write MRI
-          if( aDensity > 0 ) {
+          if (aDensity > 0) {
             // mass
             Handle(StepBasic_SiUnitAndMassUnit) SMU = new StepBasic_SiUnitAndMassUnit;
             SMU->SetName(StepBasic_sunGram);
             Handle(StepBasic_DerivedUnitElement) DUE1 = new StepBasic_DerivedUnitElement;
-            DUE1->Init(SMU,3.0);
+            DUE1->Init(SMU, 3.0);
             // length
             Handle(StepBasic_SiUnitAndLengthUnit) SLU = new StepBasic_SiUnitAndLengthUnit;
-            SLU->Init(Standard_True,StepBasic_spCenti,StepBasic_sunMetre);
+            SLU->Init(Standard_True, StepBasic_spCenti, StepBasic_sunMetre);
             Handle(StepBasic_DerivedUnitElement) DUE2 = new StepBasic_DerivedUnitElement;
-            DUE2->Init(SLU,2.0);
+            DUE2->Init(SLU, 2.0);
             // other
-            Handle(StepBasic_HArray1OfDerivedUnitElement) HADUE = new StepBasic_HArray1OfDerivedUnitElement(1,2);
-            HADUE->SetValue(1,DUE1);
-            HADUE->SetValue(2,DUE2);
+            Handle(StepBasic_HArray1OfDerivedUnitElement) HADUE = new StepBasic_HArray1OfDerivedUnitElement(1, 2);
+            HADUE->SetValue(1, DUE1);
+            HADUE->SetValue(2, DUE2);
             Handle(StepBasic_DerivedUnit) DU = new StepBasic_DerivedUnit;
             DU->Init(HADUE);
             Model->AddWithRefs(DU);
@@ -4123,48 +4148,48 @@ Standard_Boolean STEPCAFControl_Writer::WriteMaterials (const Handle(XSControl_W
             MVM->SetName(aDensValType->ToCString());
             MVM->SetReal(aDensity);
             Handle(StepRepr_MeasureRepresentationItem) MRI = new StepRepr_MeasureRepresentationItem;
-            MRI->Init(aDensName,MVM,aUnit);
-            HARI = new StepRepr_HArray1OfRepresentationItem(1,1);
-            HARI->SetValue(1,MRI);
+            MRI->Init(aDensName, MVM, aUnit);
+            HARI = new StepRepr_HArray1OfRepresentationItem(1, 1);
+            HARI->SetValue(1, MRI);
             RepMRI = new StepRepr_Representation();
-            RepMRI->Init(new TCollection_HAsciiString("density"),HARI,RC);
+            RepMRI->Init(new TCollection_HAsciiString("density"), HARI, RC);
             Model->AddWithRefs(RepMRI);
           }
           //WriteNewMaterial(Model,aName,aDescription,aDensity,aDensName,aDensValType,RC,RepDRI,RepMRI);
-          MapDRI.Bind(aKey,RepDRI);
-          if ( !RepMRI.IsNull() ) MapMRI.Bind (aKey, RepMRI);
+          MapDRI.Bind(aKey, RepDRI);
+          if (!RepMRI.IsNull()) MapMRI.Bind(aKey, RepMRI);
         }
       }
-      
-      if( !RepDRI.IsNull() )
+
+      if (!RepDRI.IsNull())
       {
         StepRepr_CharacterizedDefinition CD1;
         CD1.SetValue(aProdDef);
         Handle(StepRepr_PropertyDefinition) PropD1 = new StepRepr_PropertyDefinition;
-        PropD1->Init(new TCollection_HAsciiString("material property"),Standard_True,
-          new TCollection_HAsciiString("material name"),CD1);
+        PropD1->Init(new TCollection_HAsciiString("material property"), Standard_True,
+          new TCollection_HAsciiString("material name"), CD1);
         Model->AddWithRefs(PropD1);
         StepRepr_RepresentedDefinition RD1;
         RD1.SetValue(PropD1);
         Handle(StepRepr_PropertyDefinitionRepresentation) PDR1 =
           new StepRepr_PropertyDefinitionRepresentation;
-        PDR1->Init(RD1,RepDRI);
+        PDR1->Init(RD1, RepDRI);
         Model->AddWithRefs(PDR1);
 
-        if( !RepMRI.IsNull() )
+        if (!RepMRI.IsNull())
         {
           StepRepr_CharacterizedDefinition CD2;
-          CD2.SetValue (aProdDef);
-          Handle (StepRepr_PropertyDefinition) PropD2 = new StepRepr_PropertyDefinition;
-          PropD2->Init (new TCollection_HAsciiString ("material property"), Standard_True,
-            new TCollection_HAsciiString ("density"), CD2);
-          Model->AddWithRefs (PropD2);
+          CD2.SetValue(aProdDef);
+          Handle(StepRepr_PropertyDefinition) PropD2 = new StepRepr_PropertyDefinition;
+          PropD2->Init(new TCollection_HAsciiString("material property"), Standard_True,
+            new TCollection_HAsciiString("density"), CD2);
+          Model->AddWithRefs(PropD2);
           StepRepr_RepresentedDefinition RD2;
-          RD2.SetValue (PropD2);
-          Handle (StepRepr_PropertyDefinitionRepresentation) PDR2 =
+          RD2.SetValue(PropD2);
+          Handle(StepRepr_PropertyDefinitionRepresentation) PDR2 =
             new StepRepr_PropertyDefinitionRepresentation;
-          PDR2->Init (RD2, RepMRI);
-          Model->AddWithRefs (PDR2);
+          PDR2->Init(RD2, RepMRI);
+          Model->AddWithRefs(PDR2);
         }
       }
     }
@@ -4179,7 +4204,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteMaterials (const Handle(XSControl_W
 //purpose  : 
 //=======================================================================
 
-void STEPCAFControl_Writer::SetColorMode (const Standard_Boolean colormode)
+void STEPCAFControl_Writer::SetColorMode(const Standard_Boolean colormode)
 {
   myColorMode = colormode;
 }
@@ -4190,7 +4215,7 @@ void STEPCAFControl_Writer::SetColorMode (const Standard_Boolean colormode)
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::GetColorMode () const
+Standard_Boolean STEPCAFControl_Writer::GetColorMode() const
 {
   return myColorMode;
 }
@@ -4201,7 +4226,7 @@ Standard_Boolean STEPCAFControl_Writer::GetColorMode () const
 //purpose  : 
 //=======================================================================
 
-void STEPCAFControl_Writer::SetNameMode (const Standard_Boolean namemode)
+void STEPCAFControl_Writer::SetNameMode(const Standard_Boolean namemode)
 {
   myNameMode = namemode;
 }
@@ -4212,7 +4237,7 @@ void STEPCAFControl_Writer::SetNameMode (const Standard_Boolean namemode)
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::GetNameMode () const
+Standard_Boolean STEPCAFControl_Writer::GetNameMode() const
 {
   return myNameMode;
 }
@@ -4223,7 +4248,7 @@ Standard_Boolean STEPCAFControl_Writer::GetNameMode () const
 //purpose  : 
 //=======================================================================
 
-void STEPCAFControl_Writer::SetLayerMode (const Standard_Boolean layermode)
+void STEPCAFControl_Writer::SetLayerMode(const Standard_Boolean layermode)
 {
   myLayerMode = layermode;
 }
@@ -4234,7 +4259,7 @@ void STEPCAFControl_Writer::SetLayerMode (const Standard_Boolean layermode)
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::GetLayerMode () const
+Standard_Boolean STEPCAFControl_Writer::GetLayerMode() const
 {
   return myLayerMode;
 }
@@ -4245,7 +4270,7 @@ Standard_Boolean STEPCAFControl_Writer::GetLayerMode () const
 //purpose  : 
 //=======================================================================
 
-void STEPCAFControl_Writer::SetPropsMode (const Standard_Boolean propsmode)
+void STEPCAFControl_Writer::SetPropsMode(const Standard_Boolean propsmode)
 {
   myPropsMode = propsmode;
 }
@@ -4256,7 +4281,7 @@ void STEPCAFControl_Writer::SetPropsMode (const Standard_Boolean propsmode)
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::GetPropsMode () const
+Standard_Boolean STEPCAFControl_Writer::GetPropsMode() const
 {
   return myPropsMode;
 }
@@ -4267,7 +4292,7 @@ Standard_Boolean STEPCAFControl_Writer::GetPropsMode () const
 //purpose  : 
 //=======================================================================
 
-void STEPCAFControl_Writer::SetSHUOMode (const Standard_Boolean mode)
+void STEPCAFControl_Writer::SetSHUOMode(const Standard_Boolean mode)
 {
   mySHUOMode = mode;
 }
@@ -4278,7 +4303,7 @@ void STEPCAFControl_Writer::SetSHUOMode (const Standard_Boolean mode)
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean STEPCAFControl_Writer::GetSHUOMode () const
+Standard_Boolean STEPCAFControl_Writer::GetSHUOMode() const
 {
   return mySHUOMode;
 }
@@ -4331,8 +4356,8 @@ Standard_Boolean STEPCAFControl_Writer::GetMaterialMode() const
 //function : GetParam
 //purpose  : 
 //=======================================================================
-Handle(Interface_Static) STEPCAFControl_Writer::GetParam
-(const Standard_CString theParamName)
-{
-  return myWriter.Model()->GetParam(theParamName);
-}
+//Handle(Interface_Static) STEPCAFControl_Writer::GetParam
+//(const Standard_CString theParamName)
+//{
+//  return myWriter.Model()->GetParam(theParamName);
+//}
index 68682236c9cd70c983cec684aa1de42facc94569..23df5deb3677b32fb358a373e2656ed2a5989e89 100644 (file)
@@ -155,7 +155,7 @@ public:
   Standard_EXPORT Standard_Boolean GetMaterialMode() const;
   
   //! Returns parameter for translation by its name
-  Standard_EXPORT Handle(Interface_Static) GetParam(const Standard_CString theParamName);
+  //Standard_EXPORT Handle(Interface_Static) GetParam(const Standard_CString theParamName);
 
 
 
index 3e6fc561c619ef41e45caebe26179a0971e77af6..d368c66c160e2a9b943ad2e3dd564bb46fd8320b 100644 (file)
@@ -110,9 +110,8 @@ void STEPConstruct_ContextTool::AddAPD (const Standard_Boolean enforce)
 {
   Standard_Boolean noapd = theAPD.IsNull();
   if (noapd || enforce) theAPD  = new StepBasic_ApplicationProtocolDefinition;
-  Handle(Interface_Static) aParam = (myModel->GetParam("write.step.schema"));
-  Standard_Integer aShema = aParam.IsNull() ? 4 : aParam->IntegerValue();
 
+  Standard_Integer aShema = myModel->IVal("write.step.schema");
   switch (aShema) { //j4
   default:
   case 1:
@@ -570,9 +569,10 @@ void STEPConstruct_ContextTool::SetIndex (const Standard_Integer ind)
 Handle(TCollection_HAsciiString) STEPConstruct_ContextTool::GetProductName () const
 {
   Handle(TCollection_HAsciiString) PdtName;
-  Handle(Interface_Static) aParam = myModel->GetParam("write.step.product.name");
-  if (!aParam.IsNull() && aParam->IsSetValue())
-    PdtName = new TCollection_HAsciiString(aParam->CStringValue());
+
+  TCollection_AsciiString aName = myModel->CVal("write.step.product.name");
+  if(!aName.IsEmpty())
+    PdtName = new TCollection_HAsciiString(aName);
   else PdtName = new TCollection_HAsciiString("Product");
 
   for ( Standard_Integer i=1; i <= myLevel.Length(); i++ ) {
@@ -600,9 +600,7 @@ Handle(TColStd_HSequenceOfTransient) STEPConstruct_ContextTool::GetRootsForPart
   if ( ! SDRTool.PRPC().IsNull() ) seq->Append ( SDRTool.PRPC() );
 
   // for AP203, add required product management data
-  Handle(Interface_Static) aParam = myModel->GetParam("write.step.schema");
-  Standard_Integer aShema = aParam.IsNull() ? 4 : aParam->IntegerValue();
-  if (aShema == 3 ) {
+  if (myModel->IVal("write.step.schema") == 3 ) {
     theAP203.Init ( SDRTool );
     seq->Append (theAP203.GetProductCategoryRelationship());
     seq->Append (theAP203.GetCreator());
@@ -630,9 +628,8 @@ Handle(TColStd_HSequenceOfTransient) STEPConstruct_ContextTool::GetRootsForAssem
   Handle(TColStd_HSequenceOfTransient) seq = new TColStd_HSequenceOfTransient;
 
   seq->Append ( assembly.ItemValue() );
   // for AP203, write required product management data
-  if ( myModel->GetParam("write.step.schema")->IntegerValue() == 3 ) {
+  if (myModel->IVal("write.step.schema") == 3 ) {
     theAP203.Init ( assembly.GetNAUO() );
     seq->Append (theAP203.GetSecurity());
     seq->Append (theAP203.GetClassificationOfficer());
index 40d814008540f9012023dab66b52f7a5f27e8cb9..21508b0e8585c1137b8ac387de0001aebd3b0cc8 100644 (file)
@@ -64,7 +64,7 @@ void STEPConstruct_Part::MakeSDR(const Handle(StepShape_ShapeRepresentation)& th
                                  const Handle(Interface_InterfaceModel)& theModel)
 {
   // get current schema
-  Standard_Integer schema = theModel->GetParam("write.step.schema")->IntegerValue();
+  Standard_Integer schema = theModel->IVal("write.step.schema"); 
   
   // create PC
   Handle(StepBasic_ProductContext) PC;
@@ -147,7 +147,8 @@ void STEPConstruct_Part::MakeSDR(const Handle(StepShape_ShapeRepresentation)& th
 
   // and an associated PRPC
   Handle(TCollection_HAsciiString) PRPCName;
-  switch (theModel->GetParam("write.step.schema")->IntegerValue()) {
+  
+  switch (schema) {
   default:
   case 1: 
     myPRPC = new StepBasic_ProductType; 
index e06fd82f659d7f8f8e1194f49a1ed52e3c26c1a4..188b511557de712bac40a742d389288f615e07e6 100644 (file)
@@ -232,7 +232,8 @@ Standard_Boolean STEPConstruct_Styles::CreateMDGPR (const Handle(StepRepr_Repres
 //   Model()->AddWithRefs ( Repr ); add into the model upper
 
   // for AP203, add subschema name
-  if ( theModel->GetParam("write.step.schema")->IntegerValue() == 3 ) {
+  if ( theModel->IVal("write.step.schema") == 3 ) {
     APIHeaderSection_MakeHeader mkHdr ( Handle(StepData_StepModel)::DownCast ( Model() ) );
     Handle(TCollection_HAsciiString) subSchema = 
       new TCollection_HAsciiString ( "SHAPE_APPEARANCE_LAYER_MIM" );
index e0fb1e3c6a29e938343d8543fa2db47c586b31ee..178aa65ee5613e9ef0a0594c5a3616425b46eff3 100644 (file)
@@ -85,7 +85,8 @@ void STEPConstruct_UnitContext::Init(const Standard_Real Tol3d,
   Standard_CString uName = 0;
   Standard_Boolean hasPref = Standard_True;
   StepBasic_SiPrefix siPref = StepBasic_spMilli;
-  switch (theModel->GetParam("write.step.unit")->IntegerValue()) {
+  Standard_Integer valunits = theModel->IVal("write.step.unit");
+  switch (valunits) {
     case  1: uName = "INCH";             break;
     default:
     case  2:                             break;
@@ -106,7 +107,7 @@ void STEPConstruct_UnitContext::Init(const Standard_Real Tol3d,
   if ( uName ) { // for non-metric units, create conversion_based_unit
     Handle(StepBasic_MeasureValueMember) val = new StepBasic_MeasureValueMember;
     val->SetName("LENGTH_UNIT");
-    val->SetReal(UnitsMethods::GetLengthFactorValue(theModel->GetParam("write.step.unit")->IntegerValue()));
+    val->SetReal(UnitsMethods::GetLengthFactorValue(valunits));
 
     Handle(StepBasic_LengthMeasureWithUnit) measure = new StepBasic_LengthMeasureWithUnit;
     StepBasic_Unit Unit;
index a3e18f7c7bb35a1149ad176d89348972e83d8a66..2acfc34d089b2af59bafe53e7d4a38aeaec52ffa 100644 (file)
@@ -359,7 +359,7 @@ Standard_Boolean STEPConstruct_ValidationProps::AddProp (const StepRepr_Characte
 
   // for AP203, add subschema name
 
-  if (Model()->GetParam("write.step.schema")->IntegerValue() == 3) {
+  if (Model()->IVal("write.step.schema") == 3) {
     APIHeaderSection_MakeHeader mkHdr(Handle(StepData_StepModel)::DownCast(Model()));
     Handle(TCollection_HAsciiString) subSchema =
       new TCollection_HAsciiString("GEOMETRIC_VALIDATION_PROPERTIES_MIM");
index 2d98c60c3040cea9ff614a5a7dfd315e48c49a24..a298a3444b2af85044adc05ee2a73f6e8e6a4bb1 100644 (file)
@@ -216,7 +216,7 @@ Standard_Boolean  STEPControl_ActorRead::Recognize
 
   if (start->IsKind(STANDARD_TYPE(StepRepr_NextAssemblyUsageOccurrence))) return Standard_True;
 
-  TCollection_AsciiString aProdMode = myModel->GetParam("read.step.product.mode")->IntegerValue();
+  TCollection_AsciiString aProdMode = myModel->CVal("read.step.product.mode");
   if(!aProdMode.IsEqual("ON"))
     if(start->IsKind(STANDARD_TYPE(StepShape_ShapeDefinitionRepresentation))) return Standard_True;
 
@@ -402,7 +402,7 @@ void STEPControl_ActorRead::getSDR(const Handle(StepRepr_ProductDefinitionShape)
   // Flag indicating preferred shape representation type, to be chosen if 
   // several different representations are attached to the same shape
   Standard_Integer delta = 100;
-  Standard_Integer ICS = myModel->GetParam("read.step.shape.repr")->IntegerValue();
+  Standard_Integer ICS = myModel->IVal("read.step.shape.repr");
   Standard_Integer nbSDR0 = listSDR->Length();
   
   // Iterate by entities referring PDS
@@ -502,12 +502,12 @@ void STEPControl_ActorRead::getSDR(const Handle(StepRepr_ProductDefinitionShape)
   // Flag indicating whether SDRs associated with the product`s main SDR
   // by SRRs (which correspond to hybrid model representation in AP203 since 1998) 
   // should be taken into account 
-  Standard_Integer readSRR = myModel->GetParam("read.step.shape.relationship")->IntegerValue();
+  Standard_Integer readSRR = myModel->IVal("read.step.shape.relationship");
   
   // Flag indicating whether SDRs associated with the product`s main SDR
   // by SAs (which correspond to hybrid model representation in AP203 before 1998) 
   // should be taken into account 
-  Standard_Integer readSA = myModel->GetParam("read.step.shape.aspect")->IntegerValue();
+  Standard_Integer readSA = myModel->IVal("read.step.shape.aspect");
   if ( ! readSA ) 
     listSDRAspect->Clear();  
     
@@ -521,7 +521,7 @@ void STEPControl_ActorRead::getSDR(const Handle(StepRepr_ProductDefinitionShape)
   // possibly attached directly to intermediate assemblies (1)
   // Special mode (4) is used to translate shape attached to this product only,
   // ignoring sub-assemblies if any
-  Standard_Integer readAssembly = myModel->GetParam("read.step.assembly.level")->IntegerValue();
+  Standard_Integer readAssembly = myModel->IVal("read.step.assembly.level");
   if ( readAssembly ==3 || ( readAssembly ==2 && listNAUO->Length() >0 ) ) 
     listSDR->Clear();
   else if ( readAssembly == 4 )
@@ -772,7 +772,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(const Han
   Message_ProgressSentry PS ( TP->GetProgress(), "Sub-assembly", 0, nb, 1 );
 
   // [BEGIN] Proceed with non-manifold topology (ssv; 12.11.2010)
-  Standard_Boolean isNMMode = myModel->GetParam("read.step.nonmanifold")->IntegerValue() != 0;
+  Standard_Boolean isNMMode = myModel->IVal("read.step.nonmanifold") != 0;
   Standard_Boolean isManifold = Standard_True;
   if ( isNMMode && sr->IsKind(STANDARD_TYPE(StepShape_NonManifoldSurfaceShapeRepresentation)) ) {
     isManifold = Standard_False;
@@ -784,7 +784,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(const Han
   } 
   // Special processing for I-DEAS STP case (ssv; 15.11.2010)
   else {
-    Standard_Integer isIDeasMode = myModel->GetParam("read.step.ideas")->IntegerValue();
+    Standard_Integer isIDeasMode = myModel->IVal("read.step.ideas");
     if (isNMMode && myNMTool.IsIDEASCase() && isIDeasMode) {
       isManifold = Standard_False;
       NM_DETECTED = Standard_True;
@@ -1410,7 +1410,7 @@ Handle(Transfer_Binder) STEPControl_ActorRead::TransferShape(const Handle(Standa
   // Product Definition Entities
   // They should be treated with Design Manager
    // case ShapeDefinitionRepresentation if ProductMode != ON
-  TCollection_AsciiString aProdMode = myModel->GetParam("read.step.product.mode")->CStringValue();
+  TCollection_AsciiString aProdMode = myModel->CVal("read.step.product.mode");
   if(!aProdMode.IsEqual("ON") && 
      start->IsKind(STANDARD_TYPE(StepShape_ShapeDefinitionRepresentation))) 
     shbinder = OldWay(start,TP);
@@ -1531,7 +1531,7 @@ void STEPControl_ActorRead::PrepareUnits(const Handle(StepRepr_Representation)&
 
   if (!theGUAC.IsNull()) {
     stat1 = myUnit.ComputeFactors(theGUAC);
-    Standard_Integer anglemode = myModel->GetParam("step.angleunit.mode")->IntegerValue();
+    Standard_Integer anglemode = myModel->IVal("step.angleunit.mode");
     Standard_Real angleFactor = ( anglemode == 0 ? myUnit.PlaneAngleFactor() :
                                  anglemode == 1 ? 1. : M_PI/180. );
     UnitsMethods::InitializeFactors(myUnit.LengthFactor(),
@@ -1546,15 +1546,15 @@ void STEPControl_ActorRead::PrepareUnits(const Handle(StepRepr_Representation)&
   }
 
 //  myPrecision = Precision::Confusion();
-  if (myModel->GetParam("read.precision.mode")->IntegerValue() == 1)  //:i1 gka S4136 05.04.99
-    myPrecision = myModel->GetParam("read.precision.val")->RealValue();
+  if (myModel->IVal("read.precision.mode") == 1)  //:i1 gka S4136 05.04.99
+    myPrecision = myModel->RVal("read.precision.val");
   else if (myUnit.HasUncertainty())
     myPrecision = myUnit.Uncertainty() * myUnit.LengthFactor();
   else {
     TP->AddWarning(theRepCont,"No Length Uncertainty, value of read.precision.val is taken");
-    myPrecision = myModel->GetParam("read.precision.val")->RealValue();
+    myPrecision = myModel->RVal("read.precision.val");
   }
-  myMaxTol = Max ( myPrecision, myModel->GetParam("read.maxprecision.val")->RealValue() );
+  myMaxTol = Max ( myPrecision, myModel->RVal("read.maxprecision.val") );
   // Assign uncertainty
 #ifdef TRANSLOG
   if (TP->TraceLevel() > 1) 
@@ -1570,8 +1570,8 @@ void STEPControl_ActorRead::PrepareUnits(const Handle(StepRepr_Representation)&
 void STEPControl_ActorRead::ResetUnits ()
 {
   UnitsMethods::InitializeFactors ( 1, 1, 1 );
-  myPrecision = myModel->GetParam("read.precision.val")->RealValue();
-  myMaxTol = Max ( myPrecision, myModel->GetParam("read.maxprecision.val")->RealValue());
+  myPrecision = myModel->RVal("read.precision.val");
+  myMaxTol = Max ( myPrecision, myModel->RVal("read.maxprecision.val"));
 }
 
 //=======================================================================
index 4430547a458a4f34df45bc6b788251cd7a08213e..26b31577c8fb923572a5f28b37a6ce7372050dbc 100644 (file)
@@ -344,7 +344,7 @@ STEPControl_StepModelType STEPControl_ActorWrite::Mode () const
 
 void STEPControl_ActorWrite::SetGroupMode (const Standard_CString theParameter)
 {
-  Standard_Integer aMode = myModel->GetParam(theParameter)->IntegerValue();
+  Standard_Integer aMode = myModel->IVal(theParameter);
   if (aMode >= 0) mygroup = aMode;
 }
 
@@ -460,9 +460,9 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::Transfer (const Handle(Transfer_
   myContext.SetLevel ( 1 ); // set assembly level to 1 (to ensure)
   
   //:S4136: init UnitsMethods to reset angle unit factors (see TopoDSToStep)
-  Standard_Real lFactor = UnitsMethods::GetLengthFactorValue (myModel->GetParam( "write.step.unit" )->IntegerValue() );
+  Standard_Real lFactor = UnitsMethods::GetLengthFactorValue (myModel->IVal("write.step.unit"));
   lFactor /= UnitsMethods::GetCasCadeLengthUnit();
-  Standard_Integer anglemode = myModel->GetParam("step.angleunit.mode")->IntegerValue();
+  Standard_Integer anglemode = myModel->IVal("step.angleunit.mode");
   UnitsMethods::InitializeFactors ( lFactor, ( anglemode <= 1 ? 1. : M_PI/180. ), 1. );
 
   // create SDR
@@ -501,9 +501,9 @@ Standard_Real STEPControl_ActorWrite::usedTolerance(const Standard_Real theToler
   //    Then given to TopoDSToStep_Tool
 
   Standard_Real Tol = theToler;
-  Standard_Integer tolmod = myModel->GetParam("write.precision.mode")->IntegerValue();
+  Standard_Integer tolmod = myModel->IVal("write.precision.mode");
   if (Tol <= 0 && tolmod == 2)
-    Tol = myModel->GetParam("write.precision.val")->RealValue();
+    Tol = myModel->RVal("write.precision.val");
   if (Tol <= 0) {
     ShapeAnalysis_ShapeTolerance stu;
     Tol = stu.Tolerance(theShape, tolmod);
@@ -526,7 +526,7 @@ Standard_Boolean STEPControl_ActorWrite::IsAssembly (TopoDS_Shape &S) const
 {
   if ( ! GroupMode() || S.ShapeType() != TopAbs_COMPOUND ) return Standard_False;
   // PTV 16.09.2002  OCC725 for storing compound of vertices
-  if (myModel->GetParam("write.step.vertex.mode")->IntegerValue() == 0) {//bug 23950
+  if (myModel->IVal("write.step.vertex.mode") == 0) {//bug 23950
     if (S.ShapeType() == TopAbs_COMPOUND ) {
       Standard_Boolean IsOnlyVertices = Standard_True;
       TopoDS_Iterator anItr( S );
@@ -587,7 +587,7 @@ static Standard_Boolean transferVertex (const Handle(Transfer_FinderProcess)& FP
   MoniTool_DataMapOfShapeTransient aMap;
   TopoDSToStep_Tool aTool(aMap,
                           Standard_True,
-                          FP->Model()->GetParam("write.surfacecurve.mode")->IntegerValue());
+                          FP->Model()->IVal("write.surfacecurve.mode"));
   TopoDSToStep_MakeStepVertex aMkVrtx ( TopoDS::Vertex(aShVrtx), aTool, FP );
   
   if (!aMkVrtx.IsDone())
@@ -643,7 +643,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape (const Handle(Tran
     return TransferCompound(start, SDR0, FP);
 
   // [BEGIN] Separate manifold topology from non-manifold in group mode 0 (ssv; 18.11.2010)
-  Standard_Boolean isNMMode = myModel->GetParam("write.step.nonmanifold")->IntegerValue() != 0;
+  Standard_Boolean isNMMode = myModel->IVal("write.step.nonmanifold") != 0;
   Handle(Transfer_Binder) aNMBinder;
   if (isNMMode && !GroupMode() && theShape.ShapeType() == TopAbs_COMPOUND) {
     TopoDS_Compound aNMCompound;
@@ -763,7 +763,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape (const Handle(Tran
   Handle(TopTools_HSequenceOfShape) RepItemSeq = new TopTools_HSequenceOfShape();
   
   Standard_Boolean isSeparateVertices = 
-    myModel->GetParam("write.step.vertex.mode")->IntegerValue() == 0;//bug 23950
+    myModel->IVal("write.step.vertex.mode") == 0;//bug 23950
   // PTV 16.09.2002 OCC725 separate shape from solo vertices.
   Standard_Boolean isOnlyVertices = Standard_False;
   if (theShape.ShapeType() == TopAbs_COMPOUND) {
@@ -894,7 +894,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape (const Handle(Tran
 //    if ( DMT.IsDone() ) aShape = DMT.ModifiedShape ( aShape );
 ////    aShape = TopoDSToStep::DirectFaces(xShape);
     Handle(Standard_Transient) info;
-    Standard_Real maxTol = myModel->GetParam("read.maxprecision.val")->RealValue();
+    Standard_Real maxTol = myModel->RVal("read.maxprecision.val");
 
     TopoDS_Shape aShape;
     aShape = myXSAlgoContainer->ProcessShape(xShape, Tol, maxTol,
@@ -1173,7 +1173,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape (const Handle(Tran
       GetCasted(StepRepr_RepresentationItem, ItemSeq->Value(rep));
     items->SetValue(rep,repit);
   }
-  Standard_Integer ap = myModel->GetParam("write.step.schema")->IntegerValue();
+  Standard_Integer ap = myModel->IVal("write.step.schema");
   Transfer_SequenceOfBinder aSeqBindRelation;
   if(ap == 3 && nbs > 1) {
     Standard_Integer j = 1;
@@ -1278,7 +1278,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound (const Handle(T
   TopoDS_Shape theShape = mapper->Value();
 
   // Inspect non-manifold topology case (ssv; 10.11.2010)
-  Standard_Boolean isNMMode = myModel->GetParam("write.step.nonmanifold")->IntegerValue() != 0;
+  Standard_Boolean isNMMode = myModel->IVal("write.step.nonmanifold") != 0;
   Standard_Boolean isManifold;
   if (isNMMode)
     isManifold = IsManifoldShape(theShape);
index 1eed570933a476d4921428c40b2cfe9058d5a9c2..39542730857c519dc6236b01afe9e52af34bfd14 100644 (file)
@@ -37,7 +37,7 @@
 #include <STEPControl_ActorRead.hxx>
 #include <STEPControl_ActorWrite.hxx>
 #include <STEPControl_Controller.hxx>
-#include <StepData_FileProtocol.hxx>
+//#include <StepData_FileProtocol.hxx>
 #include <StepData_StepModel.hxx>
 #include <STEPEdit_EditContext.hxx>
 #include <STEPEdit_EditSDR.hxx>
@@ -68,12 +68,12 @@ STEPControl_Controller::STEPControl_Controller()
   static Standard_Mutex aPars;
   {
     Standard_Mutex::Sentry aLock(aPars);
-    RWHeaderSection::Init();
+    //RWHeaderSection::Init();
     RWStepAP214::Init(Handle(StepAP214_Protocol)::DownCast(myAdaptorProtocol));
 
     // initialization of Standard Shape Healing
-    ShapeExtend::Init();
-    XSAlgo::Init();
+    //ShapeExtend::Init();
+    //XSAlgo::Init();
     // init Standard Shape Processing operators
     ShapeProcess_OperLibrary::Init();
   }
index aafef56d232a9b63e4597af3ca1d6f9f799d182e..430ee22a5b0a9dc33acf65455330cfebfe57f4ae 100644 (file)
@@ -151,7 +151,7 @@ Standard_Integer STEPControl_Reader::NbRootsForTransfer()
   Standard_Integer nb = aModel->NbEntities();
   for (Standard_Integer i = 1; i <= nb; i ++) {
     Handle(Standard_Transient) ent = aModel->Value(i);
-    if (aModel->GetParam("read.step.all.shapes")->IntegerValue() == 1) {
+    if (aModel->IVal("read.step.all.shapes") == 1) {
       // Special case to read invalid shape_representation without links to shapes.
       if (ent->IsKind(STANDARD_TYPE(StepShape_ManifoldSolidBrep))) {
         Interface_EntityIterator aShareds = WS()->Graph().Sharings(ent);
@@ -211,8 +211,8 @@ Standard_Integer STEPControl_Reader::NbRootsForTransfer()
       }
       // determinate roots used ProductDefinitionContext
       if(IsRoot) {
-        const char *str1 = aModel->GetParam("read.step.product.context")->CStringValue();
-        Standard_Integer ICS = aModel->GetParam("read.step.product.context")->IntegerValue();
+        const char *str1 = aModel->CVal("read.step.product.context");
+        Standard_Integer ICS = aModel->IVal("read.step.product.context");
         if(ICS>1) {
           subs = graph.Shareds(PD);
           for(subs.Start(); subs.More(); subs.Next()) {
@@ -245,7 +245,7 @@ Standard_Integer STEPControl_Reader::NbRootsForTransfer()
         WS()->TransferReader()->TransientProcess()->RootsForTransfer()->Append(ent);
       }
     }
-    TCollection_AsciiString aProdMode = aModel->GetParam("read.step.product.mode")->CStringValue();
+    TCollection_AsciiString aProdMode = aModel->CVal("read.step.product.mode");
     if(!aProdMode.IsEqual("ON")) {
       if(ent->IsKind(STANDARD_TYPE(StepShape_ShapeDefinitionRepresentation))) {
         Standard_Boolean IsRoot = Standard_True;
index a92f41fc8f819d7408ff04797d3fc10960d0f06b..faf2f004f8e23eda1a23a487a26dbcdb95b89d9b 100644 (file)
 
 IMPLEMENT_STANDARD_RTTIEXT(StepAP214_Protocol,StepData_Protocol)
 
-static Standard_CString schemaAP214CD  = "AUTOMOTIVE_DESIGN_CC2 { 1 2 10303 214 -1 1 5 4 }";
-static Standard_CString schemaAP214DIS = "AUTOMOTIVE_DESIGN { 1 2 10303 214 0 1 1 1 }";
-static Standard_CString schemaAP214IS  = "AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }";
-static Standard_CString schemaAP203    = "CONFIG_CONTROL_DESIGN";
-static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF. {1 0 10303 442 1 1 4 }";
+Standard_CString schemaAP214CD  = "AUTOMOTIVE_DESIGN_CC2 { 1 2 10303 214 -1 1 5 4 }";
+Standard_CString schemaAP214DIS = "AUTOMOTIVE_DESIGN { 1 2 10303 214 0 1 1 1 }";
+Standard_CString schemaAP214IS  = "AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }";
+Standard_CString schemaAP203    = "CONFIG_CONTROL_DESIGN";
+Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF. {1 0 10303 442 1 1 4 }";
 
 #include <HeaderSection_Protocol.hxx>
 
index 08e87644fb100481dcde1c1c1577c7c04df18428..538e10665b0bfd20c9ec2c321deddfc98ea00df3 100644 (file)
@@ -48,13 +48,13 @@ StaticHandleA(StepData_Protocol,theheader);
   InitHandle(StepData_Protocol,theheader);
   if (theheader.IsNull()) theheader = header;
   else {
-    DeclareAndCast(StepData_FileProtocol,headmult,theheader);
-    if (headmult.IsNull()) {
-      headmult = new StepData_FileProtocol;
-      headmult->Add(theheader);
-    }
-    headmult->Add(header);
-    theheader = headmult;
+    //DeclareAndCast(StepData_FileProtocol,headmult,theheader);
+   // if (headmult.IsNull()) {
+     // headmult = new StepData_FileProtocol;
+      //headmult->Add(theheader);
+    //}
+    //headmult->Add(header);
+    //theheader = headmult;
   }
 }
 
index 0fdb5211cacfccd24b0d235f5775c87698b284cf..32e013d68b0eaa743b616258ddb586750f7b94e6 100644 (file)
@@ -46,8 +46,8 @@ class StepData_FreeFormEntity;
 class StepData_Protocol;
 class StepData_GeneralModule;
 class StepData_FileRecognizer;
-class StepData_FileProtocol;
-class StepData_HeaderTool;
+//class StepData_FileProtocol;
+//class StepData_HeaderTool;
 class StepData_EnumTool;
 class StepData_DescrProtocol;
 class StepData_DescrGeneral;
@@ -127,12 +127,12 @@ friend class StepData_FreeFormEntity;
 friend class StepData_Protocol;
 friend class StepData_GeneralModule;
 friend class StepData_FileRecognizer;
-friend class StepData_FileProtocol;
-friend class StepData_HeaderTool;
+//friend class StepData_FileProtocol;
+//friend class StepData_HeaderTool;
 friend class StepData_EnumTool;
-friend class StepData_DescrProtocol;
-friend class StepData_DescrGeneral;
-friend class StepData_DescrReadWrite;
+//friend class StepData_DescrProtocol;
+//friend class StepData_DescrGeneral;
+//friend class StepData_DescrReadWrite;
 friend class StepData_StepReaderData;
 friend class StepData_StepReaderTool;
 friend class StepData_ReadWriteModule;
@@ -140,8 +140,8 @@ friend class StepData_StepWriter;
 friend class StepData_StepDumper;
 friend class StepData_WriterLib;
 friend class StepData_DefaultGeneral;
-friend class StepData_GlobalNodeOfWriterLib;
-friend class StepData_NodeOfWriterLib;
+//friend class StepData_GlobalNodeOfWriterLib;
+//friend class StepData_NodeOfWriterLib;
 
 };
 
diff --git a/src/StepData/StepData_DescrGeneral.cxx b/src/StepData/StepData_DescrGeneral.cxx
deleted file mode 100644 (file)
index b7e4956..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-
-#include <Interface_Check.hxx>
-#include <Interface_CopyTool.hxx>
-#include <Interface_EntityIterator.hxx>
-#include <Interface_ShareTool.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
-#include <StepData_DescrGeneral.hxx>
-#include <StepData_Described.hxx>
-#include <StepData_EDescr.hxx>
-#include <StepData_Protocol.hxx>
-
-IMPLEMENT_STANDARD_RTTIEXT(StepData_DescrGeneral,StepData_GeneralModule)
-
-StepData_DescrGeneral::StepData_DescrGeneral
-  (const Handle(StepData_Protocol)& proto)
-    :  theproto (proto)    {  }
-
-
-    void  StepData_DescrGeneral::FillSharedCase
-  (const Standard_Integer, const Handle(Standard_Transient)& ent,
-   Interface_EntityIterator& iter) const
-{
-  Handle(StepData_Described) ds = Handle(StepData_Described)::DownCast(ent);
-  if (!ds.IsNull()) ds->Shared (iter);
-}
-
-
-void StepData_DescrGeneral::CheckCase(const Standard_Integer ,
-                                      const Handle(Standard_Transient)&,
-                                      const Interface_ShareTool&,
-                                      Handle(Interface_Check)&) const
-{
-}    // pour l instant
-
-
-void  StepData_DescrGeneral::CopyCase(const Standard_Integer,
-                                      const Handle(Standard_Transient)&,
-                                      const Handle(Standard_Transient)&, 
-                                      Interface_CopyTool&) const 
-{
-}    // pour l instant
-
-Standard_Boolean  StepData_DescrGeneral::NewVoid
-  (const Standard_Integer CN, Handle(Standard_Transient)& ent) const
-{
-  ent = theproto->Descr(CN)->NewEntity();
-  return (!ent.IsNull());
-}
diff --git a/src/StepData/StepData_DescrGeneral.hxx b/src/StepData/StepData_DescrGeneral.hxx
deleted file mode 100644 (file)
index b729213..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-// Created on: 1997-05-21
-// Created by: Christian CAILLET
-// Copyright (c) 1997-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _StepData_DescrGeneral_HeaderFile
-#define _StepData_DescrGeneral_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <StepData_GeneralModule.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_Boolean.hxx>
-class StepData_Protocol;
-class Standard_Transient;
-class Interface_EntityIterator;
-class Interface_ShareTool;
-class Interface_Check;
-class Interface_CopyTool;
-
-
-class StepData_DescrGeneral;
-DEFINE_STANDARD_HANDLE(StepData_DescrGeneral, StepData_GeneralModule)
-
-//! Works with a Protocol by considering its entity descriptions
-class StepData_DescrGeneral : public StepData_GeneralModule
-{
-
-public:
-
-  
-  Standard_EXPORT StepData_DescrGeneral(const Handle(StepData_Protocol)& proto);
-  
-  Standard_EXPORT void FillSharedCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE;
-  
-  Standard_EXPORT void CheckCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE;
-  
-  Standard_EXPORT void CopyCase (const Standard_Integer CN, const Handle(Standard_Transient)& entfrom, const Handle(Standard_Transient)& entto, Interface_CopyTool& TC) const Standard_OVERRIDE;
-  
-  Standard_EXPORT Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
-
-
-
-
-  DEFINE_STANDARD_RTTIEXT(StepData_DescrGeneral,StepData_GeneralModule)
-
-protected:
-
-
-
-
-private:
-
-
-  Handle(StepData_Protocol) theproto;
-
-
-};
-
-
-
-
-
-
-
-#endif // _StepData_DescrGeneral_HeaderFile
diff --git a/src/StepData/StepData_DescrProtocol.cxx b/src/StepData/StepData_DescrProtocol.cxx
deleted file mode 100644 (file)
index 89d0ae3..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-
-#include <Interface_GeneralLib.hxx>
-#include <Interface_ReaderLib.hxx>
-#include <Standard_Type.hxx>
-#include <StepData_DescrGeneral.hxx>
-#include <StepData_DescrProtocol.hxx>
-#include <StepData_DescrReadWrite.hxx>
-#include <StepData_WriterLib.hxx>
-
-IMPLEMENT_STANDARD_RTTIEXT(StepData_DescrProtocol,StepData_FileProtocol)
-
-StepData_DescrProtocol::StepData_DescrProtocol ()    {  }
-
-    void  StepData_DescrProtocol::SetSchemaName (const Standard_CString name)
-      {  thename.Clear();  thename.AssignCat (name);  }
-
-    void  StepData_DescrProtocol::LibRecord () const
-{
-  if (!HasDescr()) return;  // rien a recorder dans la lib ?
-  Handle(StepData_DescrGeneral)   gen = new StepData_DescrGeneral   (this);
-  Handle(StepData_DescrReadWrite) rwm = new StepData_DescrReadWrite (this);
-  Interface_GeneralLib::SetGlobal (gen,this);
-  Interface_ReaderLib::SetGlobal   (rwm,this);
-  StepData_WriterLib::SetGlobal   (rwm,this);
-}
-
-    Standard_CString  StepData_DescrProtocol::SchemaName (Standard_Integer /*theShematype*/)
-      {  return thename.ToCString();  }
diff --git a/src/StepData/StepData_DescrProtocol.hxx b/src/StepData/StepData_DescrProtocol.hxx
deleted file mode 100644 (file)
index f85d60d..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-// Created on: 1997-05-21
-// Created by: Christian CAILLET
-// Copyright (c) 1997-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _StepData_DescrProtocol_HeaderFile
-#define _StepData_DescrProtocol_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <TCollection_AsciiString.hxx>
-#include <StepData_FileProtocol.hxx>
-#include <Standard_CString.hxx>
-
-
-class StepData_DescrProtocol;
-DEFINE_STANDARD_HANDLE(StepData_DescrProtocol, StepData_FileProtocol)
-
-//! A DescrProtocol is a protocol dynamically (at execution time)
-//! defined with :
-//! - a list of resources (inherits FileProtocol)
-//! - a list of entity descriptions
-//! i.e. it can be defined with only C++ writing to initialize it
-//! Its initialization must :
-//! - set its schema name
-//! - define its resources (which can also be other DescrProtocol)
-//! - define its entity descriptions
-//! - record it in the system by calling RecordLib
-class StepData_DescrProtocol : public StepData_FileProtocol
-{
-
-public:
-
-  
-  Standard_EXPORT StepData_DescrProtocol();
-  
-  //! Defines a specific Schema Name for this Protocol
-  Standard_EXPORT void SetSchemaName (const Standard_CString name);
-  
-  //! Records this Protocol in the service libraries, with a
-  //! DescrGeneral and a DescrReadWrite
-  //! Does nothing if the Protocol brings no proper description
-  Standard_EXPORT void LibRecord() const;
-  
-  //! Returns the Schema Name attached to each class of Protocol
-  //! here, returns the SchemaName set by SetSchemaName
-  //! was C++ : return const
-  Standard_EXPORT virtual Standard_CString SchemaName(Standard_Integer theShematype) Standard_OVERRIDE;
-
-
-
-
-  DEFINE_STANDARD_RTTIEXT(StepData_DescrProtocol,StepData_FileProtocol)
-
-protected:
-
-
-
-
-private:
-
-
-  TCollection_AsciiString thename;
-
-
-};
-
-
-
-
-
-
-
-#endif // _StepData_DescrProtocol_HeaderFile
diff --git a/src/StepData/StepData_DescrReadWrite.cxx b/src/StepData/StepData_DescrReadWrite.cxx
deleted file mode 100644 (file)
index 8104858..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-
-#include <Interface_Check.hxx>
-#include <Interface_Macros.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Type.hxx>
-#include <StepData_DescrReadWrite.hxx>
-#include <StepData_ECDescr.hxx>
-#include <StepData_EDescr.hxx>
-#include <StepData_ESDescr.hxx>
-#include <StepData_FieldListN.hxx>
-#include <StepData_Plex.hxx>
-#include <StepData_Protocol.hxx>
-#include <StepData_Simple.hxx>
-#include <StepData_StepReaderData.hxx>
-#include <StepData_StepWriter.hxx>
-#include <TCollection_AsciiString.hxx>
-#include <TColStd_HSequenceOfAsciiString.hxx>
-
-IMPLEMENT_STANDARD_RTTIEXT(StepData_DescrReadWrite,StepData_ReadWriteModule)
-
-static TCollection_AsciiString nocp("?");
-
-
-    StepData_DescrReadWrite::StepData_DescrReadWrite
-  (const Handle(StepData_Protocol)& proto)
-    : theproto (proto)    {  }
-
-    Standard_Integer  StepData_DescrReadWrite::CaseStep
-  (const TCollection_AsciiString& atype) const
-{
-  Handle(StepData_ESDescr) descr = theproto->ESDescr (atype.ToCString(),Standard_False);
-  if (descr.IsNull()) return 0;
-  return theproto->DescrNumber (descr);
-}
-
-    Standard_Integer  StepData_DescrReadWrite::CaseStep
-  (const TColStd_SequenceOfAsciiString& types) const
-{
-  Handle(StepData_ECDescr) descr = theproto->ECDescr (types,Standard_False);
-  if (descr.IsNull()) return 0;
-  return theproto->DescrNumber (descr);
-}
-
-
-    Standard_Boolean  StepData_DescrReadWrite::IsComplex
-  (const Standard_Integer CN) const
-{
-  Handle(StepData_EDescr)  descr = theproto->Descr (CN);
-  if (descr.IsNull()) return Standard_False;
-  return descr->IsComplex();
-}
-
-    const TCollection_AsciiString& StepData_DescrReadWrite::StepType
-  (const Standard_Integer CN) const
-{
-  Handle(StepData_ESDescr)  descr = Handle(StepData_ESDescr)::DownCast
-    (theproto->Descr (CN));
-  if (descr.IsNull()) return nocp;
-  return descr->StepType();
-}
-
-    Standard_Boolean StepData_DescrReadWrite::ComplexType
-  (const Standard_Integer CN, TColStd_SequenceOfAsciiString& types) const
-{
-  Handle(StepData_ECDescr)  descr = Handle(StepData_ECDescr)::DownCast
-    (theproto->Descr (CN));
-  if (descr.IsNull()) return Standard_False;
-  Handle(TColStd_HSequenceOfAsciiString) list = descr->TypeList();
-  if (list.IsNull()) return Standard_False;
-  Standard_Integer i, nb = list->Length();
-  for (i = 1; i <= nb; i ++)  types.Append (list->Value(i));
-  return Standard_True;
-}
-
-
-void StepData_DescrReadWrite::ReadStep(const Standard_Integer CN,
-                                       const Handle(StepData_StepReaderData)& data,
-                                       const Standard_Integer num,
-                                       Handle(Interface_Check)& ach,
-                                       const Handle(Standard_Transient)&ent) const
-{
-  if (CN == 0) return;
-  DeclareAndCast(StepData_Simple,sent,ent);
-  if (!sent.IsNull()) {
-    Handle(StepData_ESDescr) sdescr = sent->ESDescr();
-    StepData_FieldListN& fl = sent->CFields();
-    data->ReadList (num,ach,sdescr,fl);
-    return;
-  }
-
-  DeclareAndCast(StepData_Plex,cent,ent);
-  Standard_Integer i, nb=0;
-  if (!cent.IsNull()) nb = cent->NbMembers();
-  Standard_Integer n0 = num;
-  for (i = 1; i <= nb; i ++) {
-    Handle(StepData_Simple) si = cent->Member(i);
-    Handle(StepData_ESDescr) sdescr = si->ESDescr();
-    StepData_FieldListN& fl = si->CFields();
-    data->ReadList (n0,ach,sdescr,fl);
-    if (i < nb) n0 = data->NextForComplex(n0);
-  }
-}
-
-
-    void StepData_DescrReadWrite::WriteStep
-  (const Standard_Integer CN,
-   StepData_StepWriter& SW,
-   const Handle(Standard_Transient)&ent) const
-{
-  if (CN == 0) return;
-
-  DeclareAndCast(StepData_Simple,sent,ent);
-  if (!sent.IsNull()) {
-    Handle(StepData_ESDescr) sdescr = sent->ESDescr();
-    const StepData_FieldListN& fl = sent->Fields();
-    SW.SendList (fl,sdescr);
-    return;
-  }
-
-  DeclareAndCast(StepData_Plex,cent,ent);
-  Standard_Integer i, nb=0;
-  if (!cent.IsNull()) nb = cent->NbMembers();
-  for (i = 1; i <= nb; i ++) {
-    Handle(StepData_Simple) si = cent->Member(i);
-    Handle(StepData_ESDescr) sdescr = si->ESDescr();
-      const StepData_FieldListN& fl = si->Fields();
-      SW.StartEntity (sdescr->TypeName());
-      SW.SendList (fl,sdescr);
-  }
-}
diff --git a/src/StepData/StepData_DescrReadWrite.hxx b/src/StepData/StepData_DescrReadWrite.hxx
deleted file mode 100644 (file)
index 5248f70..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-// Created on: 1997-05-21
-// Created by: Christian CAILLET
-// Copyright (c) 1997-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _StepData_DescrReadWrite_HeaderFile
-#define _StepData_DescrReadWrite_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <StepData_ReadWriteModule.hxx>
-#include <Standard_Integer.hxx>
-#include <TColStd_SequenceOfAsciiString.hxx>
-#include <Standard_Boolean.hxx>
-class StepData_Protocol;
-class TCollection_AsciiString;
-class StepData_StepReaderData;
-class Interface_Check;
-class Standard_Transient;
-class StepData_StepWriter;
-
-
-class StepData_DescrReadWrite;
-DEFINE_STANDARD_HANDLE(StepData_DescrReadWrite, StepData_ReadWriteModule)
-
-
-class StepData_DescrReadWrite : public StepData_ReadWriteModule
-{
-
-public:
-
-  
-  Standard_EXPORT StepData_DescrReadWrite(const Handle(StepData_Protocol)& proto);
-  
-  Standard_EXPORT Standard_Integer CaseStep (const TCollection_AsciiString& atype) const Standard_OVERRIDE;
-  
-  Standard_EXPORT virtual Standard_Integer CaseStep (const TColStd_SequenceOfAsciiString& types) const Standard_OVERRIDE;
-  
-  Standard_EXPORT virtual Standard_Boolean IsComplex (const Standard_Integer CN) const Standard_OVERRIDE;
-  
-  Standard_EXPORT const TCollection_AsciiString& StepType (const Standard_Integer CN) const Standard_OVERRIDE;
-  
-  Standard_EXPORT virtual Standard_Boolean ComplexType (const Standard_Integer CN, TColStd_SequenceOfAsciiString& types) const Standard_OVERRIDE;
-  
-  Standard_EXPORT void ReadStep (const Standard_Integer CN, const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
-  
-  Standard_EXPORT void WriteStep (const Standard_Integer CN, StepData_StepWriter& SW, const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
-
-
-
-
-  DEFINE_STANDARD_RTTIEXT(StepData_DescrReadWrite,StepData_ReadWriteModule)
-
-protected:
-
-
-
-
-private:
-
-
-  Handle(StepData_Protocol) theproto;
-
-
-};
-
-
-
-
-
-
-
-#endif // _StepData_DescrReadWrite_HeaderFile
diff --git a/src/StepData/StepData_FileProtocol.cxx b/src/StepData/StepData_FileProtocol.cxx
deleted file mode 100644 (file)
index 6078e1e..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-
-#include <Interface_Check.hxx>
-#include <Interface_Graph.hxx>
-#include <Interface_Protocol.hxx>
-#include <Standard_Type.hxx>
-#include <StepData_FileProtocol.hxx>
-#include <StepData_Protocol.hxx>
-
-IMPLEMENT_STANDARD_RTTIEXT(StepData_FileProtocol,StepData_Protocol)
-
-//static TCollection_AsciiString  thename("");
-static Standard_CString  thename = "";
-
-//  Protocol fabrique a la demande avec d autres Protocoles
-
-
-    StepData_FileProtocol::StepData_FileProtocol ()    {  }
-
-    void StepData_FileProtocol::Add (const Handle(StepData_Protocol)& protocol)
-{
-  if (protocol.IsNull()) return;
-  Handle(Standard_Type) ptype = protocol->DynamicType();
-  Standard_Integer nb = thecomps.Length();
-  for (Standard_Integer i = 1; i <= nb; i ++) {
-    if (thecomps.Value(i)->IsInstance(ptype)) return;
-  }
-  thecomps.Append(protocol);
-}
-
-
-    Standard_Integer  StepData_FileProtocol::NbResources () const
-      {  return thecomps.Length();  }
-
-    Handle(Interface_Protocol) StepData_FileProtocol::Resource
-  (const Standard_Integer num) const
-      {  return Handle(Interface_Protocol)::DownCast(thecomps.Value(num));  }
-
-
-    Standard_Integer  StepData_FileProtocol::TypeNumber
-  (const Handle(Standard_Type)& /*atype*/) const
-      {  return 0;  }
-
-
-Standard_Boolean StepData_FileProtocol::GlobalCheck(const Interface_Graph& G,
-                                                    Handle(Interface_Check)& ach) const
-{
-  Standard_Boolean res = Standard_False;
-  Standard_Integer i,nb = NbResources();
-  for (i = 1; i <= nb; i ++) res |= Resource(i)->GlobalCheck (G,ach);
-  return res;
-}
-
-
-    Standard_CString StepData_FileProtocol::SchemaName (Standard_Integer /*theShematype*/)
-      {  return thename;  }
diff --git a/src/StepData/StepData_FileProtocol.hxx b/src/StepData/StepData_FileProtocol.hxx
deleted file mode 100644 (file)
index 7fe343b..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-// Created on: 1993-07-23
-// Created by: Christian CAILLET
-// Copyright (c) 1993-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _StepData_FileProtocol_HeaderFile
-#define _StepData_FileProtocol_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <TColStd_SequenceOfTransient.hxx>
-#include <StepData_Protocol.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_Type.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_CString.hxx>
-class StepData_Protocol;
-class Interface_Protocol;
-class Interface_Graph;
-class Interface_Check;
-
-
-class StepData_FileProtocol;
-DEFINE_STANDARD_HANDLE(StepData_FileProtocol, StepData_Protocol)
-
-//! A FileProtocol is defined as the addition of several already
-//! existing Protocols. It corresponds to the definition of a
-//! SchemaName with several Names, each one being attached to a
-//! specific Protocol. Thus, a File defined with a compound Schema
-//! is processed as any other one, once built the equivalent
-//! compound Protocol, a FileProtocol
-class StepData_FileProtocol : public StepData_Protocol
-{
-
-public:
-
-  
-  //! Creates an empty FileProtocol
-  Standard_EXPORT StepData_FileProtocol();
-  
-  //! Adds a Protocol to the definition list of the FileProtocol
-  //! But ensures that each class of Protocol is present only once
-  //! in this list
-  Standard_EXPORT void Add (const Handle(StepData_Protocol)& protocol);
-  
-  //! Gives the count of Protocols used as Resource (can be zero)
-  //! i.e. the count of Protocol recorded by calling the method Add
-  Standard_EXPORT virtual Standard_Integer NbResources() const Standard_OVERRIDE;
-  
-  //! Returns a Resource, given a rank. Here, rank of calling Add
-  Standard_EXPORT virtual Handle(Interface_Protocol) Resource (const Standard_Integer num) const Standard_OVERRIDE;
-  
-  //! Returns a Case Number, specific of each recognized Type
-  //! Here, NO Type at all is recognized properly : all Types are
-  //! recognized by the resources
-  Standard_EXPORT virtual Standard_Integer TypeNumber (const Handle(Standard_Type)& atype) const Standard_OVERRIDE;
-  
-  //! Calls GlobalCheck for each of its recorded ressources
-  Standard_EXPORT virtual Standard_Boolean GlobalCheck (const Interface_Graph& G, Handle(Interface_Check)& ach) const Standard_OVERRIDE;
-  
-  //! Returns the Schema Name attached to each class of Protocol
-  //! To be redefined by each sub-class
-  //! Here, SchemaName returns "" (empty String)
-  //! was C++ : return const
-  Standard_EXPORT virtual Standard_CString SchemaName(Standard_Integer theShematype) Standard_OVERRIDE;
-
-
-
-
-  DEFINE_STANDARD_RTTIEXT(StepData_FileProtocol,StepData_Protocol)
-
-protected:
-
-
-
-
-private:
-
-
-  TColStd_SequenceOfTransient thecomps;
-
-
-};
-
-
-
-
-
-
-
-#endif // _StepData_FileProtocol_HeaderFile
diff --git a/src/StepData/StepData_HeaderTool.cxx b/src/StepData/StepData_HeaderTool.cxx
deleted file mode 100644 (file)
index 5e95539..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-
-#include <Interface_Protocol.hxx>
-#include <Interface_ReaderLib.hxx>
-#include <StepData_FileProtocol.hxx>
-#include <StepData_HeaderTool.hxx>
-#include <StepData_Protocol.hxx>
-#include <StepData_StepReaderData.hxx>
-#include <TCollection_AsciiString.hxx>
-
-//  HeaderTool prend en charge le Schema de Donnees utilise pour un Fichier
-//  Ce Schema peut etre compose de un ou plusieurs Protocoles, chacun etant
-//  designe par une String. Les Strings correspondent au type "SCHEMA_NAME"
-//  (typedef) et le Schema est une entite de Header de type "FILE_SCHEMA",
-//  il a cette forme dans le fichier :
-static Interface_ReaderLib lib;
-
-
-    StepData_HeaderTool::StepData_HeaderTool
-  (const Handle(StepData_StepReaderData)& data)
-{
-  lib.SetComplete();
-  thedone = Standard_False;
-  Standard_Integer num = 0;
-  while ( (num = data->FindNextRecord(num)) != 0) {
-    const TCollection_AsciiString& headertype = data->RecordType(num);
-    if (headertype == "FILE_SCHEMA") {
-      Standard_Integer numsub = data->SubListNumber(num,1,Standard_True);
-      Standard_Integer nb = data->NbParams(numsub);
-      for (Standard_Integer i = 1; i <= nb; i ++) {
-       TCollection_AsciiString unom = data->ParamCValue(numsub,i);
-       unom.Remove(unom.Length());
-       unom.Remove(1);               // quotes debut et fin
-       thenames.Append(unom);
-      }
-    }
-  }
-}
-
-
-    StepData_HeaderTool::StepData_HeaderTool
-  (const TColStd_SequenceOfAsciiString& names)
-{
-  lib.SetComplete();
-  thedone = Standard_False;
-  Standard_Integer nb = names.Length();
-  for (Standard_Integer i = 1; i <= nb; i ++) thenames.Append(names.Value(i));
-}
-
-    Standard_Integer StepData_HeaderTool::NbSchemaNames () const
-      {  return thenames.Length();  }
-
-    const TCollection_AsciiString& StepData_HeaderTool::SchemaName
-  (const Standard_Integer num) const
-      {  return thenames.Value(num);  }
-
-    Handle(StepData_Protocol) StepData_HeaderTool::NamedProtocol
-  (const TCollection_AsciiString& name) const
-{
-  Handle(StepData_Protocol) proto;
-  for (lib.Start(); lib.More(); lib.Next()) {
-    proto = Handle(StepData_Protocol)::DownCast(lib.Protocol());
-    if ( name.IsEqual(proto->SchemaName()) ) return proto;
-  }
-  return proto;
-}
-
-
-    void StepData_HeaderTool::Build
-  (const Handle(StepData_FileProtocol)& proto)
-{
-  thedone = Standard_True;
-  theignored.Clear();
-  Standard_Integer nb = thenames.Length();
-  for (Standard_Integer i = 1; i <= nb; i ++) {
-    Handle(StepData_Protocol) unproto = NamedProtocol(thenames.Value(i));
-    if (unproto.IsNull()) theignored.Append(thenames.Value(i));
-    else proto->Add(unproto);
-  }
-}
-
-    Handle(StepData_Protocol) StepData_HeaderTool::Protocol ()
-{
-  thedone = Standard_True;
-  theignored.Clear();
-  Handle(StepData_Protocol) unproto;
-  if (thenames.IsEmpty()) return unproto;
-  if (thenames.Length() == 1) {
-    unproto = NamedProtocol (thenames.Value(1));
-    if (unproto.IsNull()) theignored.Append (thenames.Value(1));
-    return unproto;
-  }
-  Handle(StepData_FileProtocol) proto = new StepData_FileProtocol;
-  Build(proto);
-  return proto;
-}
-
-
-    Standard_Boolean StepData_HeaderTool::IsDone () const
-      {  return thedone;  }
-
-
-    Standard_Integer StepData_HeaderTool::NbIgnoreds () const
-      {  return theignored.Length();  }
-
-    const TCollection_AsciiString& StepData_HeaderTool::Ignored
-  (const Standard_Integer num) const
-      {  return theignored.Value(num);  }
-
-
-    void StepData_HeaderTool::Print (Standard_OStream& S) const
-{
-  Standard_Integer nb = thenames.Length();
-  Standard_Integer lng = 0;  Standard_Integer ln1;
-  S << " ---  StepData_HeaderTool : List of Protocol Names  ---  Count : "
-    << nb << endl;
-  Standard_Integer i; // svv Jan11 2000 : porting on DEC
-  for (i = 1; i <= nb; i ++) {
-    ln1 = thenames.Value(i).Length() + 8;  lng += ln1;
-    if (lng > 80) {  S << endl;  lng = ln1;  }
-    S << "  " << i << " : " << thenames.Value(i);
-  }
-  if (lng == 0) S << endl;
-
-  nb = theignored.Length();
-  if (!thedone) {
-    S << " ---   Evaluation of Protocol not Done   ---" << endl;
-  } else if (nb == 0) {
-    S << " ---   All Names correspond to a known Protocol  ---" << endl;
-  } else {
-    lng = ln1 = 0;
-    S << " ---   Among them, " << nb << " remain unrecognized  ---" << endl;
-    for (i = 1; i <= nb; i ++) {
-      ln1 = theignored.Value(i).Length() + 3;  lng += ln1;
-      if (lng > 80) {  S << endl;  lng = ln1;  }
-      S << " : " << theignored.Value(i);
-    }
-    if (lng == 0) S << endl;
-  }
-}
diff --git a/src/StepData/StepData_HeaderTool.hxx b/src/StepData/StepData_HeaderTool.hxx
deleted file mode 100644 (file)
index fc293c9..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-// Created on: 1993-07-23
-// Created by: Christian CAILLET
-// Copyright (c) 1993-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _StepData_HeaderTool_HeaderFile
-#define _StepData_HeaderTool_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
-#include <TColStd_SequenceOfAsciiString.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_OStream.hxx>
-class StepData_StepReaderData;
-class TCollection_AsciiString;
-class StepData_Protocol;
-class StepData_FileProtocol;
-
-
-//! HeaderTool exploits data from Header to build a Protocol :
-//! it uses the Header Entity FileSchema to do this.
-//! It builds a Protocol from the Global List of Protocols
-//! stored in the Library ReaderLib
-class StepData_HeaderTool 
-{
-public:
-
-  DEFINE_STANDARD_ALLOC
-
-  
-  //! Creates a HeaderTool from data read from a File. Computes the
-  //! list of Schema Names. The Protocol will be computed later
-  //! (because there are several options)
-  Standard_EXPORT StepData_HeaderTool(const Handle(StepData_StepReaderData)& data);
-  
-  //! Creates a HeaderTool directly from a list of Schema Names
-  Standard_EXPORT StepData_HeaderTool(const TColStd_SequenceOfAsciiString& names);
-  
-  //! Returns the count of SchemaNames
-  Standard_EXPORT Standard_Integer NbSchemaNames() const;
-  
-  //! Returns a SchemaName, given its rank
-  Standard_EXPORT const TCollection_AsciiString& SchemaName (const Standard_Integer num) const;
-  
-  //! Returns the Protocol which corresponds to a Schema Name
-  //! Returns a Null Handle if this Schema Name is attached to no
-  //! Protocol recorded in the Global List of ReaderLib
-  Standard_EXPORT Handle(StepData_Protocol) NamedProtocol (const TCollection_AsciiString& name) const;
-  
-  //! Fills a FileProtocol with the list of Protocols attached to
-  //! the list of Schema Names. It can remain empty ...
-  Standard_EXPORT void Build (const Handle(StepData_FileProtocol)& protocol);
-  
-  //! Returns a Protocol computed from the list of Schema Names :
-  //! - a Null Handle if no SchemaName has been recognized (or list
-  //! empty)
-  //! - a single Protocol if only one SchemaName has been recognized
-  //! - a FileProtocol with its componants if several SchemaNames
-  //! have been recognized
-  Standard_EXPORT Handle(StepData_Protocol) Protocol();
-  
-  //! Returns True if either Build or Protocol has been called
-  //! If it is False, Ignored and NbIgnored should not be called
-  Standard_EXPORT Standard_Boolean IsDone() const;
-  
-  //! Returns the count of ignored SchemaNames (0 if all were OK)
-  Standard_EXPORT Standard_Integer NbIgnoreds() const;
-  
-  //! Returns an ignored SchemaName, given its rank in the list of
-  //! Ignored SchemaNames (not in the total list)
-  Standard_EXPORT const TCollection_AsciiString& Ignored (const Standard_Integer num) const;
-  
-  //! Sends the state of the HeaderTool in a comprehensive way,
-  //! to an output stream
-  Standard_EXPORT void Print (Standard_OStream& S) const;
-
-
-
-
-protected:
-
-
-
-
-
-private:
-
-
-
-  TColStd_SequenceOfAsciiString thenames;
-  Standard_Boolean thedone;
-  TColStd_SequenceOfAsciiString theignored;
-
-
-};
-
-
-
-
-
-
-
-#endif // _StepData_HeaderTool_HeaderFile
index 2a1445848cbbefbc251fd2da20b9cf7d324f02d9..3416b05ac84ff8ec4867e30a8a0971d54720e386 100644 (file)
@@ -396,19 +396,19 @@ void StepData_StepModel::AddHeaderEntity
 {  theheader.Append(ent);  }
 
 
-void StepData_StepModel::VerifyCheck(Handle(Interface_Check)& ach) const
-{
-  /*Interface_GeneralLib lib(StepData::HeaderProtocol());
-  Handle(StepData_StepModel) me (this);
-  Handle(Interface_Protocol) aHP = StepData::HeaderProtocol();
-  Interface_ShareTool sh(me,aHP);
-  Handle(Interface_GeneralModule) module;  Standard_Integer CN;
-  for (Interface_EntityIterator iter = Header(); iter.More(); iter.Next()) {
-    Handle(Standard_Transient) head = iter.Value();
-    if (!lib.Select(head,module,CN)) continue;
-    module->CheckCase(CN,head,sh,ach);
-  }*/
-}
+//void StepData_StepModel::VerifyCheck(Handle(Interface_Check)& ach) const
+//{
+//  Interface_GeneralLib lib(StepData::HeaderProtocol());
+//  Handle(StepData_StepModel) me (this);
+//  Handle(Interface_Protocol) aHP = StepData::HeaderProtocol();
+//  Interface_ShareTool sh(me,aHP);
+//  Handle(Interface_GeneralModule) module;  Standard_Integer CN;
+//  for (Interface_EntityIterator iter = Header(); iter.More(); iter.Next()) {
+//    Handle(Standard_Transient) head = iter.Value();
+//    if (!lib.Select(head,module,CN)) continue;
+//    module->CheckCase(CN,head,sh,ach);
+//  }
+//}
 
 
 void StepData_StepModel::DumpHeader
index ef1da359db337b813ca7752ba9333cdaed53ec77..6a59f2e8c1c30d9f66a8dd49b14b938c1794af78 100644 (file)
@@ -78,7 +78,7 @@ public:
   Standard_EXPORT void AddHeaderEntity (const Handle(Standard_Transient)& ent);
   
   //! Specific Check, checks Header Items with HeaderProtocol
-  Standard_EXPORT virtual void VerifyCheck (Handle(Interface_Check)& ach) const Standard_OVERRIDE;
+  //Standard_EXPORT virtual void VerifyCheck (Handle(Interface_Check)& ach) const Standard_OVERRIDE;
   
   //! Dumps the Header, with the Header Protocol of StepData.
   //! If the Header Protocol is not defined, for each Header Entity,
index fe22bb87140ca896346ae504f3c845e6cfef5090..5991388f08fc43d2466e7e62b73785dfb7f46136 100644 (file)
 #include <Interface_FileReaderTool.hxx>
 #include <Standard_Boolean.hxx>
 #include <Standard_Integer.hxx>
+#include <NCollection_List.hxx>
+#include <StepData_GeneralModule.hxx>
+#include <StepData_ReadWriteModule.hxx>
+
 class StepData_FileRecognizer;
 class StepData_StepReaderData;
 class StepData_Protocol;
@@ -100,7 +104,8 @@ protected:
 
 private:
 
-
+  NCollection_List<Handle(StepData_GeneralModule)> myglib;
+  NCollection_List<Handle(StepData_ReadWriteModule)> myrlib;
 
   Handle(StepData_FileRecognizer) thereco;
   Interface_GeneralLib theglib;
index 416757e5a3ecbb7e7679ca79f73a3e1f1d4ae616..484e778567c96deae2705f9fa70f1a1204dcbacc 100644 (file)
@@ -56,8 +56,7 @@ static TCollection_AsciiString lastvalue;
   Standard_Boolean ok = thelib.Select (ent,module,CN);
   if (!ok) {
     lastvalue.AssignCat ("..NOT FROM SCHEMA ");
-    Standard_Integer aval = model->GetParam("write.step.schema").IsNull() ?
-      0 : model->GetParam("write.step.schema")->IntegerValue();
+    Standard_Integer aval = model->IVal("write.step.schema");
     lastvalue.AssignCat (theproto->SchemaName(aval));
     lastvalue.AssignCat ("..");
   } else {
index e88ef77e87306276ac9ac845dc03a6887c8d0a26..b8f076390d063057b87c8dcd94c4b5b9f993eeac 100644 (file)
@@ -93,7 +93,7 @@ static void ResetPreci (const TopoDS_Shape& S,
                         const Handle(Interface_InterfaceModel)& theModel)
 {
   //:S4136
-  Standard_Integer modetol = theModel->GetParam("read.maxprecision.mode")->IntegerValue();
+  Standard_Integer modetol = theModel->IVal("read.maxprecision.mode");
   if (modetol) {
     ShapeFix_ShapeTolerance STU;
     STU.LimitTolerance (S,Precision::Confusion(),maxtol);
index 086c6d3abc9a18e5259497839f64b5c903debcea..6a90973ae9b129927eac4c2f6be2d72d0d7823fe 100644 (file)
@@ -106,7 +106,7 @@ Standard_Boolean StepToTopoDS_TranslateCompositeCurve::Init (const Handle(StepGe
   Standard_Boolean isClosed = Standard_False;
 
   if ( SurfMode ) {
-    Standard_Integer modepcurve = TP->Model()->GetParam("read.surfacecurve.mode")->IntegerValue();
+    Standard_Integer modepcurve = TP->Model()->IVal("read.surfacecurve.mode");
     if ( modepcurve ==-3 ) SurfMode = Standard_False;
   }
   
index 24987fd63029dc0f5118f57116b5002f263858b1..5f51cb19afd30bb1e30abe094c5ebb395227e0e0 100644 (file)
@@ -225,7 +225,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
   Handle(StepData_StepModel) aModel =
     Handle(StepData_StepModel)::DownCast(aTool.TransientProcess()->Model());
 
-  Standard_Integer modepcurve = aModel->GetParam("read.surfacecurve.mode")->IntegerValue();
+  Standard_Integer modepcurve = aModel->IVal("read.surfacecurve.mode");
 //  0,1 : suivre le code,  2 : ne prendre que pcurve,  3 : ne prendre que C3D
 
   BRep_Builder B;
index 411645425bc7e884cc0a8df9228c6d460a49e877..9ef84851caf2eb7238a97a1a90dd80cc73cbeed1 100644 (file)
@@ -77,7 +77,7 @@ TopoDSToStep_MakeBrepWithVoids::
          CurrentShell.Reverse(); 
        //:d7 abv 16 Mar 98: try to treat 'open' shells as closed since flag 
        // IsClosed() is often incorrect (taken from MakeManifoldSolid(Solid))
-       aTool.Init(aMap, Standard_False, FP->Model()->GetParam("write.surfacecurve.mode")->IntegerValue());
+       aTool.Init(aMap, Standard_False, FP->Model()->IVal("write.surfacecurve.mode"));
        StepB.Init(CurrentShell, aTool, FP);
        TopoDSToStep::AddResult ( FP, aTool );
        if (StepB.IsDone()) {
index 05169a6e1ce65c710abcc375ae7425ce83a35712..17e998a5d8b8549190cdfa4dc51712f574431c27 100644 (file)
@@ -45,7 +45,7 @@ TopoDSToStep_MakeFacetedBrep::
     MoniTool_DataMapOfShapeTransient aMap;
     TopoDSToStep_Tool aTool(aMap,
                             Standard_True,
-                            FP->Model()->GetParam("write.surfacecurve.mode")->IntegerValue());
+                            FP->Model()->IVal("write.surfacecurve.mode"));
     TopoDSToStep_Builder StepB(aShell, aTool, FP);
     TopoDSToStep::AddResult ( FP, aTool );
 
@@ -94,7 +94,7 @@ TopoDSToStep_MakeFacetedBrep::
       MoniTool_DataMapOfShapeTransient aMap;
       TopoDSToStep_Tool aTool(aMap,
                               Standard_True,
-                              FP->Model()->GetParam("write.surfacecurve.mode")->IntegerValue());
+                              FP->Model()->IVal("write.surfacecurve.mode"));
       TopoDSToStep_Builder StepB(aOuterShell, aTool, FP);
       TopoDSToStep::AddResult ( FP, aTool );
       
index 030023eeb9fd2b49f59be725a94bb65ce6b1c3d7..5bd750195020835b9c68347ab78510e1061670f2 100644 (file)
@@ -68,7 +68,7 @@ TopoDSToStep_MakeFacetedBrepAndBrepWithVoids::
        TopoDS_Shell CurrentShell = TopoDS::Shell(It.Value());
        if (It.Value().Closed()) {
 
-          aTool.Init(aMap, Standard_False, FP->Model()->GetParam("write.surfacecurve.mode")->IntegerValue());
+          aTool.Init(aMap, Standard_False, FP->Model()->IVal("write.surfacecurve.mode"));
          StepB.Init(CurrentShell, aTool, FP);
          TopoDSToStep::AddResult ( FP, aTool );
 
index 6697015508a7d7c7fd83ee6e7a01a19ee8e5e6b1..ef5bcd5b18d2f0c608213102c6ccf98a0a111777 100644 (file)
@@ -46,7 +46,7 @@ TopoDSToStep_MakeGeometricCurveSet::TopoDSToStep_MakeGeometricCurveSet(
   MoniTool_DataMapOfShapeTransient      aMap;
   TopoDSToStep_Tool aTool (aMap,
                            Standard_False,
-                           FP->Model()->GetParam("write.surfacecurve.mode")->IntegerValue());
+                           FP->Model()->IVal("write.surfacecurve.mode"));
   TopoDSToStep_WireframeBuilder    wirefB (aShape, aTool, FP);
   TopoDSToStep::AddResult ( FP, aTool );
 
index 0a7fbf3a681d2abd5c9e49bb3d91f78d497da179..ed0b8c31ec106d4a82a80c8d9fbb0443bcc8d46d 100644 (file)
@@ -39,7 +39,7 @@ static Handle(StepShape_ManifoldSolidBrep) MakeManifoldSolidBrep (const TopoDS_S
 
   MoniTool_DataMapOfShapeTransient aMap;
   Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(FP->Model());
-  TopoDSToStep_Tool aTool(aMap, Standard_False, aModel->GetParam("write.surfacecurve.mode")->IntegerValue());
+  TopoDSToStep_Tool aTool(aMap, Standard_False, aModel->IVal("write.surfacecurve.mode"));
   
   TopoDSToStep_Builder StepB(aShell, aTool, FP);
 
index 40261b18147a324cc2bd633f5570b547dcd6929f..696b231bd3183f1231302e3feb78d0421a5a0e93 100644 (file)
@@ -54,7 +54,7 @@ TopoDSToStep_MakeShellBasedSurfaceModel::
   Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(FP->Model());
   TopoDSToStep_Tool    aTool(aMap,
                              Standard_False,
-                             aModel->GetParam("write.surfacecurve.mode")->IntegerValue());
+                             aModel->IVal("write.surfacecurve.mode"));
   TopoDSToStep_Builder StepB(aFace, aTool, FP);
 
   TopoDSToStep::AddResult ( FP, aTool );
@@ -105,7 +105,7 @@ TopoDSToStep_MakeShellBasedSurfaceModel::
   Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(FP->Model());
   TopoDSToStep_Tool    aTool(aMap,
                              Standard_False,
-                             aModel->GetParam("write.surfacecurve.mode")->IntegerValue());
+                             aModel->IVal("write.surfacecurve.mode"));
   TopoDSToStep_Builder StepB(aShell, aTool, FP);
   //TopoDSToStep::AddResult ( FP, aTool );
 
@@ -166,7 +166,7 @@ TopoDSToStep_MakeShellBasedSurfaceModel::
       Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(FP->Model());
       TopoDSToStep_Tool    aTool(aMap,
                                  Standard_False,
-                                 aModel->GetParam("write.surfacecurve.mode")->IntegerValue());
+                                 aModel->IVal("write.surfacecurve.mode"));
       TopoDSToStep_Builder StepB(aShell, aTool, FP);
       TopoDSToStep::AddResult ( FP, aTool );
 
index 6714c92e846f1ecfe1eb443b428142d039a43980..df98f71789009f68001f7383d9e50193b7f19afe 100644 (file)
@@ -91,7 +91,7 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
   // [BEGIN] Processing non-manifold topology (ssv; 11.11.2010)
 
   Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(FP->Model());
-  Standard_Boolean isNMMode = aModel->GetParam("write.step.nonmanifold")->IntegerValue() != 0;
+  Standard_Boolean isNMMode = aModel->IVal("write.step.nonmanifold") != 0;
   if (isNMMode) {
     Handle(StepShape_EdgeCurve) anEC;
     Handle(TransferBRep_ShapeMapper) aSTEPMapper = TransferBRep::ShapeMapper(FP, aEdge);
index 0950c57414c29306194ba3d1de81a766363c5b5e..7c0809e0daf2e241d98c69f6f9a036862a3763d5 100644 (file)
@@ -126,7 +126,7 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace,
 
   // [BEGIN] Processing non-manifold topology (another approach) (ssv; 10.11.2010)
   Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(FP->Model());
-  Standard_Boolean isNMMode = aModel->GetParam("write.step.nonmanifold")->IntegerValue() != 0;
+  Standard_Boolean isNMMode = aModel->IVal("write.step.nonmanifold") != 0;
   if (isNMMode) {
     Handle(StepShape_AdvancedFace) anAF;
     Handle(TransferBRep_ShapeMapper) aSTEPMapper = TransferBRep::ShapeMapper(FP, aFace);
@@ -232,7 +232,7 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace,
       // surface of revolution (necessary e.g. for CATIA)
       if (VL - VF - 2 * M_PI < -Precision::PConfusion())
       {
-        Handle(ShapeAlgo_AlgoContainer) aContainer = new ShapeAlgo_AlgoContainer;
+        //Handle(ShapeAlgo_AlgoContainer) aContainer = new ShapeAlgo_AlgoContainer;
         BasisCurve = aContainer->ConvertCurveToBSpline(BasisCurve, VF, VL, Precision::Approximation(),
                                                          GeomAbs_C1, 100, 9);
         //BasisCurve = new Geom_TrimmedCurve ( BasisCurve, VF, VL );
index 3a8db511f96eff40e993de3686e6d864baed00a3..e34c4e716002475bdd80e34f799b100d2c70c9ed 100644 (file)
@@ -63,7 +63,7 @@ void TopoDSToStep_MakeStepVertex::Init(const TopoDS_Vertex& aVertex,
 
   // [BEGIN] Processing non-manifold topology (ssv; 11.11.2010)
   Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(FP->Model());
-  Standard_Boolean isNMMode = aModel->GetParam("write.step.nonmanifold")->IntegerValue() != 0;
+  Standard_Boolean isNMMode = aModel->IVal("write.step.nonmanifold") != 0;
   if (isNMMode) {
     Handle(StepShape_VertexPoint) aVP;
     Handle(TransferBRep_ShapeMapper) aSTEPMapper = TransferBRep::ShapeMapper(FP, aVertex);
index a34c63de30a61af9012f5058c37a81c5fba4e6d7..4f069b8ac60fab4e504221844faa4d3aa98a580d 100644 (file)
@@ -84,8 +84,7 @@ XSAlgo_AlgoContainer::XSAlgo_AlgoContainer()
 
 void XSAlgo_AlgoContainer::PrepareForTransfer() const
 {
-  Handle(Interface_Static) aParam = getParam("xstep.cascade.unit");
-  UnitsMethods::SetCasCadeLengthUnit(aParam.IsNull() ? 2 : aParam->IntegerValue());
+  UnitsMethods::SetCasCadeLengthUnit(IVal("xstep.cascade.unit"));
 }
 
 //=======================================================================
@@ -106,7 +105,7 @@ TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape (const TopoDS_Shape& shape,
   Handle(ShapeProcess_ShapeContext) context = Handle(ShapeProcess_ShapeContext)::DownCast(info);
   if ( context.IsNull() )
   {
-    Standard_CString rscfile = getParam(prscfile)->CStringValue();
+    Standard_CString rscfile = CVal(prscfile); 
     if (!rscfile)
       rscfile = prscfile;
     context = new ShapeProcess_ShapeContext(shape, rscfile);
@@ -115,8 +114,7 @@ TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape (const TopoDS_Shape& shape,
       context->SetProgress(progress);
   }
   info = context;
-  
-  Standard_CString seq = getParam(pseq)->CStringValue();
+  Standard_CString seq = CVal(pseq);
   if ( ! seq ) seq = pseq;
   
   // if resource file is not loaded or does not define <seq>.exec.op, 
@@ -360,8 +358,8 @@ Standard_Boolean XSAlgo_AlgoContainer::CheckPCurve (const TopoDS_Edge& E,
   B.Range(edge,face,w1,w2);
   B.SameRange(edge, Standard_False );
   //:S4136
-  Handle(Interface_Static) aParam = getParam("read.stdsameparameter.mode");
-  Standard_Integer SPmode = aParam.IsNull() ?  0 : aParam->IntegerValue();
+  
+  Standard_Integer SPmode = IVal("read.stdsameparameter.mode");
   if ( SPmode ) 
     B.SameParameter (edge, Standard_False );
 
@@ -603,6 +601,37 @@ Handle(Interface_Static) XSAlgo_AlgoContainer::getParam
   return aParam;
 }
 
+
+//=======================================================================
+//function : IVal
+//purpose  : 
+//=======================================================================
+Standard_Integer XSAlgo_AlgoContainer::IVal(const Standard_CString theParamName) const
+{
+  Handle(Interface_Static) aParam = getParam(theParamName);
+  return (aParam.IsNull() ? 0 : aParam->IntegerValue());
+}
+
+//=======================================================================
+//function : RVal
+//purpose  : 
+//=======================================================================
+Standard_Real XSAlgo_AlgoContainer::RVal(const Standard_CString theParamName) const
+{
+  Handle(Interface_Static) aParam = getParam(theParamName);
+  return (aParam.IsNull() ? 0.0 : aParam->RealValue());
+}
+
+//=======================================================================
+//function : CVal
+//purpose  : 
+//=======================================================================
+Standard_CString XSAlgo_AlgoContainer::CVal(const Standard_CString theParamName) const
+{
+  Handle(Interface_Static) aParam = getParam(theParamName);
+  return (aParam.IsNull() ? "" : aParam->CStringValue());
+}
+
 void XSAlgo_AlgoContainer::initParameters()
 {
   if (myModel.IsNull())
index 0b80437640e49252d6b0795575f0bb41c41f97e3..f0ced5eb7d56d3d277a33102b68b169f9669dc37 100644 (file)
@@ -94,6 +94,11 @@ protected:
   //! First tries get it from non-static model,
   //! if failure get it from static map
   Standard_EXPORT Handle(Interface_Static) getParam(const Standard_CString theParamName) const;
+
+  Standard_EXPORT Standard_Integer IVal(const Standard_CString theParamName) const;
+  Standard_EXPORT Standard_Real RVal(const Standard_CString theParamName) const;
+  Standard_EXPORT Standard_CString CVal(const Standard_CString theParamName) const;
+
   void initParameters();
 
 private:
index b16bce116c938b694643d4822c51c0e9bfbd7b3b..aed1ba3dfc6b75b5224b2b1923b3a2c1c841b354 100644 (file)
@@ -61,6 +61,7 @@
 #include <XSControl_SignTransferStatus.hxx>
 #include <XSControl_TransferReader.hxx>
 #include <XSControl_WorkSession.hxx>
+#include <Standard_Mutex.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(XSControl_Controller,Standard_Transient)
 
@@ -140,15 +141,19 @@ void XSControl_Controller::SetNames (const Standard_CString theLongName, const S
 
 void XSControl_Controller::Record (const Standard_CString theName) const
 {
-  if (listad.IsBound(theName)) {
-    Handle(Standard_Transient) thisadapt(this);
-    Handle(Standard_Transient) newadapt = listad.ChangeFind(theName);
-    if (newadapt->IsKind(thisadapt->DynamicType()))
-      return;
-    if (!(thisadapt->IsKind(newadapt->DynamicType())) && thisadapt != newadapt)
-      throw Standard_DomainError("XSControl_Controller : Record");
+  static Standard_Mutex aPars;
+  {
+    Standard_Mutex::Sentry aLock(aPars);
+    if (listad.IsBound(theName)) {
+      Handle(Standard_Transient) thisadapt(this);
+      Handle(Standard_Transient) newadapt = listad.ChangeFind(theName);
+      if (newadapt->IsKind(thisadapt->DynamicType()))
+        return;
+      if (!(thisadapt->IsKind(newadapt->DynamicType())) && thisadapt != newadapt)
+        throw Standard_DomainError("XSControl_Controller : Record");
+    }
+    listad.Bind(theName, this);
   }
-  listad.Bind(theName, this);
 }
 
 //=======================================================================
@@ -158,10 +163,14 @@ void XSControl_Controller::Record (const Standard_CString theName) const
 
 Handle(XSControl_Controller) XSControl_Controller::Recorded(const Standard_CString theName)
 {
-  Handle(Standard_Transient) recorded;
-  return (listad.Find(theName, recorded)?
-    Handle(XSControl_Controller)::DownCast(recorded) :
-    Handle(XSControl_Controller)());
+  static Standard_Mutex aPars;
+  {
+    Standard_Mutex::Sentry aLock(aPars);
+    Handle(Standard_Transient) recorded;
+    return (listad.Find(theName, recorded) ?
+      Handle(XSControl_Controller)::DownCast(recorded) :
+      Handle(XSControl_Controller)());
+  }
 }
 
 //    ####    DEFINITION    ####
index 87aaa064d754c775e9eb54084f6706c320c1ea67..df057a542cc7da7fad58e1992ef392890ba21cc1 100644 (file)
@@ -225,6 +225,7 @@ class XSControl_Controller : public Standard_Transient
   NCollection_Vector<Handle(Standard_Transient)> myParams;
   NCollection_Vector<Standard_Integer> myParamUses;
   Handle(Interface_HArray1OfHAsciiString) myModeWriteShapeN;
+  
 };
 
 #endif // _XSControl_Controller_HeaderFile
index 2f1bcaf04c9c9044ef2a5f9daef8c40fc92898cf..aa1c4f19dfa2b33f67d920e0850481d35254c28d 100644 (file)
@@ -80,12 +80,13 @@ static IFSelect_ReturnStatus XSControl_xnorm(const Handle(IFSelect_SessionPilot)
       <<  "  Short name (resource) : "<<control->Name(Standard_True)<<endl;
   if (argc == 1) return IFSelect_RetVoid;
 
-  control = XSControl_Controller::Recorded(arg1);
+  control = WS->Recorded(arg1);
   if (control.IsNull()) {
     sout<<" No norm named : "<<arg1<<endl;
     return IFSelect_RetError;
   }
 
   WS->SetController(control);
   sout<<"new norm : "<<control->Name()<<endl;
   return IFSelect_RetDone;
index f2f14bb2b9c6759f3986c84f7d1bdd5742018786..431c2e634acfcb7de5e10b60b5f0d6f66df99084 100644 (file)
@@ -86,12 +86,19 @@ Standard_Boolean  XSControl_WorkSession::SelectNorm(const Standard_CString normn
 {
   // Old norm and results
   myTransferReader->Clear(-1);
-  //  ????  En toute rigueur, menage a faire dans XWS : virer les items
-  //        ( a la limite, pourquoi pas, refaire XWS en entier)
-
-  Handle(XSControl_Controller) newadapt = XSControl_Controller::Recorded (normname);
+  if (!myController.IsNull())
+  {
+    TCollection_AsciiString aN1 =myController->Name(Standard_False);
+    TCollection_AsciiString aN2 = myController->Name(Standard_True);
+    
+    if (aN1.IsEqual(normname) || aN2.IsEqual(normname))
+      return Standard_True;
+  }
+  Handle(XSControl_Controller) newadapt = (!myMapCtl.IsBound(normname) ? 
+    XSControl_Controller::Recorded(normname) : myMapCtl.Find(normname));
   if (newadapt.IsNull()) return Standard_False;
-  if (newadapt == myController) return Standard_True;
   SetController (newadapt);
   return Standard_True;
 }
@@ -121,6 +128,21 @@ void XSControl_WorkSession::SetController(const Handle(XSControl_Controller)& ct
 
   myTransferReader->SetController (myController);
   myTransferWriter->SetController (myController);
+  if (!myMapCtl.IsBound(ctl->Name(Standard_True)))
+  {
+    myMapCtl.Bind(ctl->Name(Standard_True), ctl);
+    myMapCtl.Bind(ctl->Name(Standard_False), ctl);
+  }
+  else
+  {
+    Handle(XSControl_Controller) aController = myMapCtl.Find(ctl->Name(Standard_True));
+    if (!aController->DynamicType()->IsKind(ctl->DynamicType()))
+    {
+      myMapCtl.Bind(ctl->Name(Standard_True), ctl);
+      myMapCtl.Bind(ctl->Name(Standard_False), ctl);
+    }
+      
+  }
 }
 
 
index a1645382530078abdc91fb9620b7cbc53a443a53..d61a2cf9387532e4de996ac3d05510fda06a19ba 100644 (file)
@@ -23,7 +23,8 @@
 #include <IFSelect_WorkSession.hxx>
 #include <IFSelect_ReturnStatus.hxx>
 #include <XSControl_TransferWriter.hxx>
-class XSControl_Controller;
+#include <XSControl_Controller.hxx>
+//class XSControl_Controller;
 class XSControl_TransferReader;
 class XSControl_Vars;
 class Message_Messenger;
@@ -180,6 +181,13 @@ class XSControl_WorkSession : public IFSelect_WorkSession
   //! resulting entities (in the resulting file model) rather than
   //! with original objects (in fact, their mappers)
   Standard_EXPORT Interface_CheckIterator TransferWriteCheckList() const;
+
+  Standard_EXPORT Handle(XSControl_Controller) Recorded(const Standard_CString theNormName)
+  {
+    if(!myMapCtl.IsBound(theNormName))
+      return 0;
+    return myMapCtl.Find(theNormName);
+  }
   
   const Handle(XSControl_Vars) & Vars() const
   { return myVars; }
@@ -199,6 +207,7 @@ class XSControl_WorkSession : public IFSelect_WorkSession
   Handle(XSControl_TransferWriter) myTransferWriter;
   NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)> myContext;
   Handle(XSControl_Vars) myVars;
+  NCollection_DataMap<TCollection_AsciiString, Handle(XSControl_Controller)> myMapCtl;
 };
 
 #endif // _XSControl_WorkSession_HeaderFile
index eac3ad3f2a99c06118f4ce37e07ae286b5155a0b..54fccd6616ca9fcb9580a1c0819239c6d55226a7 100644 (file)
@@ -692,7 +692,8 @@ void  XSDRAWIGES::InitSelect ()
   Handle(IGESSelect_Activator)    igesact = new IGESSelect_Activator;
   IGESControl_Controller::Init();
 //  XSDRAW::SetNorm ("IGES");  trop tot
-  XSDRAW::SetController (XSControl_Controller::Recorded("iges"));
+  Handle(IGESControl_Controller) igesCtl = new IGESControl_Controller;
+  XSDRAW::SetController (igesCtl);
   
   atexit (cleanpilot);
 }
index 232a4ae565177962c389113a9dfab0244cf2c040..118b2fdc8d8ebd4959841b0c871c83b40c56e3a1 100644 (file)
@@ -427,76 +427,27 @@ static Standard_Integer stepread (Draw_Interpretor& di/*theCommands*/, Standard_
 //=======================================================================
 static Standard_Integer testread (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
 {
-  if (argc < 3)                                                                                      
-    {                                                                                             
-      di << "ERROR in " << argv[0] << "Wrong Number of Arguments.\n";                     
-      di << " Usage : " << argv[0] <<" file_name shape_name\n";                          
-      return 1;                                                                                 
-    }
-  STEPControl_Reader Reader;
-  Standard_Integer k =2;
-  for( ; k < argc; k++)
+  if (argc != 3)
   {
-    Standard_CString filename = argv[k];
-    IFSelect_ReturnStatus readstat = Reader.ReadFile(filename);
-    
-
-   /* di<<"Status from reading STEP file "<<filename<<" : ";  
-    switch(readstat) {                                                              
-    case IFSelect_RetVoid  : { di<<"empty file\n"; return 1; }            
-    case IFSelect_RetDone  : { di<<"file read\n";    break; }             
-    case IFSelect_RetError : { di<<"file not found\n";   return 1; }      
-    case IFSelect_RetFail  : { di<<"error during read\n";  return 1; }    
-    default  :  { di<<"failure\n";   return 1; }                          
-    }  */
-    Standard_Integer nbEnt1 = Reader.Model()->NbEntities();
-    //di<<"Number of entities : "<<k<<" "<<nbEnt1<<"\n";
+    di << "ERROR in " << argv[0] << "Wrong Number of Arguments.\n";
+    di << " Usage : " << argv[0] << " file_name shape_name\n";
+    return 1;
   }
-  
-  Standard_Integer nbEnt = Reader.Model()->NbEntities();
- /* di<<"Sum number of entities : "<<nbEnt<<"\n";
-  STEPControl_Writer Writer(Reader.WS(), Standard_False);
-  TCollection_AsciiString filename_out = "Result.stp";
-  Writer.Write(filename_out);*/
-  Standard_Integer nbRoots = Reader.TransferRoots();
-  //Standard_Integer k =1;
-  TopoDS_Compound aComp;
-  BRep_Builder aB;
-  aB.MakeCompound(aComp);
-  gp_Pnt aP1(0.,0.,0.);
-  for ( k =1; k <= nbRoots; k++)
-  {
-    if(Reader.TransferRoot(k))
-    {
-      TopoDS_Shape shape = Reader.Shape(k);
-       if( k == nbRoots)
-        {
-          gp_Trsf aT1;
-          gp_Pnt aP2(10.,0.,0.);
-          aT1.SetTranslation(aP1, aP2);
-          TopLoc_Location aLoc(aT1);
-          TopoDS_Shape aSh1= shape.Moved(aLoc);
-          aB.Add(aComp, aSh1);
-          gp_Trsf aT2;
-          gp_Pnt aP3(20.,0.,0.);
-          aT2.SetTranslation(aP1, aP3);
-          TopLoc_Location aLoc2(aT2);
-          TopoDS_Shape aSh2= shape.Moved(aLoc2);
-          aB.Add(aComp, aSh2);
-
-        }
-        else
-          aB.Add(aComp, shape);
-
-      }
-    }
-
-  
-
-  //TopoDS_Shape shape = Reader.OneShape();
-
-  DBRep::Set(argv[1],aComp); 
-  di<<"Count of shapes produced : "<<Reader.NbShapes()<<"\n";
+  STEPControl_Reader Reader;
+  Standard_CString filename = argv[1];
+  IFSelect_ReturnStatus readstat = Reader.ReadFile(filename);
+  di << "Status from reading STEP file " << filename << " : ";
+  switch (readstat) {
+  case IFSelect_RetVoid: { di << "empty file\n"; return 1; }
+  case IFSelect_RetDone: { di << "file read\n";    break; }
+  case IFSelect_RetError: { di << "file not found\n";   return 1; }
+  case IFSelect_RetFail: { di << "error during read\n";  return 1; }
+  default: { di << "failure\n";   return 1; }
+  }
+  Reader.TransferRoots();
+  TopoDS_Shape shape = Reader.OneShape();
+  DBRep::Set(argv[2], shape);
+  di << "Count of shapes produced : " << Reader.NbShapes() << "\n";
   return 0;
 }
  
index 1b547c2fe20507151198182f3810481a8c29e7be..b500e4aa0c0f58ef949536b71b2507e036b2c38f 100644 (file)
@@ -2,12 +2,12 @@
 set filename stepBF3.stp
 
 set ref_data {
-DATA        : Faulties = 0  ( 26 )  Warnings = 0  ( 0 )  Summary  = 0  ( 26 )
-TPSTAT      : Faulties = 0  ( 2 )  Warnings = 0  ( 0 )  Summary  = 0  ( 2 )
-CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 0  ( 0 )   Summary  = 1  ( 1 )
-STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 0  ( 0 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 0  ( 0 )
-TOLERANCE   : MaxTol   =              0  (              0 )  AvgTol   =               0  (               0 )
+DATA        : Faulties = 0  ( 22 )  Warnings = 0  ( 0 )  Summary  = 0  ( 22 )
+TPSTAT      : Faulties = 0  ( 0 )  Warnings = 4  ( 88 )  Summary  = 4  ( 88 )
+CHECKSHAPE  : Wires    = 1  ( 1 )  Faces    = 1  ( 1 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
+NBSHAPES    : Solid    = 1  ( 1 )  Shell    = 1  ( 1 )  Face     = 153  ( 153 )   Summary  = 940  ( 940 )
+STATSHAPE   : Solid    = 1  ( 1 )  Shell    = 1  ( 1 )  Face     = 153  ( 153 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 370  ( 370 )
+TOLERANCE   : MaxTol   =    14.04618892  (    14.04618892 )  AvgTol   =   0.02494942781  (   0.02495341469 )
 LABELS      : N0Labels = 1  ( 1 )  N1Labels = 0  ( 0 )  N2Labels = 0  ( 0 )   TotalLabels = 1  ( 1 )   NameLabels = 1  ( 1 )   ColorLabels = 0  ( 0 )   LayerLabels = 0  ( 0 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 0  ( 0 )
index 874b06f7c3cffcf46783ef25e31706a04554b5d4..90531d5d18171391bde93a4b826339360236518b 100644 (file)
@@ -1,17 +1,19 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 puts "TODO CR23096 ALL: NBSHAPES : Faulty" 
-puts "TODO CR23096 Linux: Error : 2 differences with reference data found :" 
+
+
+puts "TODO CR23096 ALL: Error : 2 differences with reference data found :" 
 
 set LinuxDiff 2
 set filename trj12_b3-sy-214.stp
 
 set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
-TPSTAT      : Faulties = 0  ( 0 )  Warnings = 283  ( 203 )  Summary  = 283  ( 203 )
+TPSTAT      : Faulties = 0  ( 0 )  Warnings = 58  ( 203 )  Summary  = 58  ( 203 )
 CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 1  ( 1 )  Shell    = 1  ( 1 )  Face     = 862  ( 862 )   Summary  = 5603  ( 5611 )
-STATSHAPE   : Solid    = 1  ( 1 )  Shell    = 1  ( 1 )  Face     = 862  ( 862 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 2367  ( 2375 )
-TOLERANCE   : MaxTol   =   0.2981250817  (   0.1424276318 )  AvgTol   =  0.001247316194  (  0.000646415041 )
+NBSHAPES    : Solid    = 1  ( 1 )  Shell    = 1  ( 1 )  Face     = 862  ( 862 )   Summary  = 5602  ( 5611 )
+STATSHAPE   : Solid    = 1  ( 1 )  Shell    = 1  ( 1 )  Face     = 862  ( 862 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 2366  ( 2375 )
+TOLERANCE   : MaxTol   =   0.1424276318  (   0.1424276318 )  AvgTol   =  0.0006794519311  (  0.0006799360048 )
 LABELS      : N0Labels = 1  ( 1 )  N1Labels = 0  ( 0 )  N2Labels = 0  ( 0 )   TotalLabels = 1  ( 1 )   NameLabels = 1  ( 1 )   ColorLabels = 1  ( 1 )   LayerLabels = 0  ( 0 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 1  ( 1 )