Eliminating of warning
[occt.git] / src / STEPCAFControl / STEPCAFControl_Reader.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 6eb1906..4c2f2e3
@@ -1,22 +1,17 @@
 // Created on: 2000-08-15
 // Created by: Andrey BETENEV
-// Copyright (c) 2000-2012 OPEN CASCADE SAS
+// Copyright (c) 2000-2014 OPEN CASCADE SAS
 //
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
+// This file is part of Open CASCADE Technology software library.
 //
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+// 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.
 //
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
-
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
 
 #include <STEPCAFControl_Reader.ixx>
 
@@ -227,6 +222,7 @@ STEPCAFControl_Reader::STEPCAFControl_Reader ():
        myNameMode ( Standard_True ),
        myLayerMode( Standard_True ),
        myPropsMode( Standard_True ),
+          mySHUOMode ( Standard_False ),
        myGDTMode  ( Standard_True ),
        myMatMode  ( Standard_True )
 {
@@ -246,6 +242,7 @@ STEPCAFControl_Reader::STEPCAFControl_Reader (const Handle(XSControl_WorkSession
        myNameMode ( Standard_True ),
        myLayerMode( Standard_True ),
        myPropsMode( Standard_True ),
+          mySHUOMode ( Standard_False ),
        myGDTMode  ( Standard_True ),
        myMatMode  ( Standard_True )
 {
@@ -426,7 +423,7 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
   if ( num <=0 ) return Standard_False;
   if ( nroot ) {
     if ( nroot > num ) return Standard_False;
-    reader.TransferOneRoot ( num );
+    reader.TransferOneRoot ( nroot );
   }
   else {
     for ( i=1; i <= num; i++ ) reader.TransferOneRoot ( i );
@@ -501,24 +498,26 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
       static Handle(TCollection_HAsciiString) ap214 = new TCollection_HAsciiString ( "STEP AP214" );
       if ( ! format->IsSameString ( ap203, Standard_False ) && 
           ! format->IsSameString ( ap214, Standard_False ) ) {
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
        cout << "Warning: STEPCAFControl_Reader::Transfer: Extern document is neither STEP AP203 nor AP214" << endl;
 #else
        continue;
 #endif
       }
     }
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
     else cout << "Warning: STEPCAFControl_Reader::Transfer: Extern document format not defined" << endl;
 #endif
     
     // get and check filename of the current extern ref
     const Standard_CString filename = ExtRefs.FileName(i);
 
-cout<<"filename="<<filename<<endl;
+#ifdef STEPCAFCONTROL_DEB
+    cout<<"filename="<<filename<<endl;
+#endif
 
     if ( ! filename || ! filename[0] ) {
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
       cout << "Warning: STEPCAFControl_Reader::Transfer: Extern reference file name is empty" << endl;
 #endif
       continue; // not a valid extern ref
@@ -661,7 +660,7 @@ TDF_Label STEPCAFControl_Reader::AddShape (const TopoDS_Shape &S,
          return EF->GetLabel();
        }
       }
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
       if ( ! EF->GetLabel().IsNull() )
         cout << "Warning: STEPCAFControl_Reader::AddShape: Non-empty shape with external ref; ref is ignored" << endl;
       else if ( nbComponents <=0 ) 
@@ -710,7 +709,7 @@ Handle(STEPCAFControl_ExternFile) STEPCAFControl_Reader::ReadExternFile (const S
     return myFiles->Item ( file );
   }
 
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
   cout << "Reading extern file: " << fullname << endl;
 #endif
  
@@ -791,7 +790,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadColors (const Handle(XSControl_WorkS
 {
   STEPConstruct_Styles Styles ( WS );
   if ( ! Styles.LoadStyles() ) {
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
     cout << "Warning: no styles are found in the model" << endl;
 #endif
     return Standard_False;
@@ -966,7 +965,7 @@ TDF_Label STEPCAFControl_Reader::FindInstance (const Handle(StepRepr_NextAssembl
   Handle(Transfer_TransientProcess) TP = Tool.TransientProcess();
   Handle(Transfer_Binder) binder = TP->Find(NAUO);
   if ( binder.IsNull() || ! binder->HasResult() ) {
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
     cout << "Error: STEPCAFControl_Reader::FindInstance: NAUO is not mapped to shape" << endl;
 #endif
     return L;
@@ -974,7 +973,7 @@ TDF_Label STEPCAFControl_Reader::FindInstance (const Handle(StepRepr_NextAssembl
   
   TopoDS_Shape S = TransferBRep::ShapeResult ( TP, binder );
   if ( S.IsNull() ) {
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
     cout << "Error: STEPCAFControl_Reader::FindInstance: NAUO is not mapped to shape" << endl;
 #endif
     return L;
@@ -1152,7 +1151,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadValProps (const Handle(XSControl_Wor
   TColStd_SequenceOfTransient props;
   STEPConstruct_ValidationProps Props ( WS );
   if ( ! Props.LoadProps ( props ) ) {
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
     cout << "Warning: no validation props found in the model" << endl;
 #endif
     return Standard_False;
@@ -1313,7 +1312,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadLayers (const Handle(XSControl_WorkS
     Interface_EntityIterator subs = WS->Graph().Sharings(SVPLA);
     for (subs.Start(); subs.More(); subs.Next()) {
       if ( ! subs.Value()->IsKind(STANDARD_TYPE(StepVisual_Invisibility)) ) continue;
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
       cout<< "\tLayer \"" << aLayerName << "\" is invisible"<<endl;
 #endif
       //TDF_Label InvLayerLab = LTool->FindLayer(aLayerName);
@@ -1390,7 +1389,7 @@ static TDF_Label setSHUOintoDoc (const Handle(XSControl_WorkSession) &WS,
   Handle(StepRepr_NextAssemblyUsageOccurrence) NUNAUO =
     Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast(SHUO->NextUsage());
   if ( UUNAUO.IsNull() || NUNAUO.IsNull() ) {
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
     cout << "Warning: " << __FILE__ <<": Upper_usage or Next_usage of styled SHUO is null. Skip it" << endl;
 #endif
     return aMainLabel;
@@ -1449,7 +1448,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadSHUOs (const Handle(XSControl_WorkSe
   
   STEPConstruct_Styles Styles ( WS );
   if ( ! Styles.LoadStyles() ) {
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
     cout << "Warning: no styles are found in the model" << endl;
 #endif
     return Standard_False;
@@ -1469,7 +1468,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadSHUOs (const Handle(XSControl_WorkSe
       if ( style != aHSeqOfInvisStyle->Value( si ) )
         continue;
       // found that current style is invisible.
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
       cout << "Warning: item No " << i << "(" << style->Item()->DynamicType()->Name() << ") is invisible" << endl;
 #endif
       IsVisible = Standard_False;
@@ -1508,7 +1507,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadSHUOs (const Handle(XSControl_WorkSe
       // set the SHUO structure to the document
       TDF_Label aLabelForStyle = setSHUOintoDoc( WS, SHUO, STool, PDFileMap, ShapeLabelMap );
       if ( aLabelForStyle.IsNull() ) {
-#ifdef DEB
+#ifdef STEPCAFCONTROL_DEB
         cout << "Warning: " << __FILE__ <<": coudnot create SHUO structure in the document" << endl;
 #endif
         continue;
@@ -2187,7 +2186,7 @@ void STEPCAFControl_Reader::ExpandManifoldSolidBrep(TDF_Label& ShapeLab,
 {
   // Access outer shell
   Handle(StepShape_ManifoldSolidBrep) aMSB = Handle(StepShape_ManifoldSolidBrep)::DownCast(Repr);
-  Handle(StepShape_ClosedShell) aShell = aMSB->Outer();
+  Handle(StepShape_ConnectedFaceSet) aShell = aMSB->Outer();
 
   // Expand shell contents to CAF tree
   ExpandShell(aShell, ShapeLab, TP, ShapeTool);