mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024788: Foundation Classes - remove Dico_Dictionary
Class Dico_Dictionary was replaced by NCollection_DataMap/NCollection_IndexedDataMap classes. Changed argument name in template class NCollection_Datamap to eliminate redefinitions of static members in dependent code.
This commit is contained in:
@@ -14,17 +14,11 @@ STEPCAFControl_DataMapOfPDExternFile.hxx
|
||||
STEPCAFControl_DataMapOfSDRExternFile.hxx
|
||||
STEPCAFControl_DataMapOfShapePD.hxx
|
||||
STEPCAFControl_DataMapOfShapeSDR.hxx
|
||||
STEPCAFControl_DictionaryOfExternFile.hxx
|
||||
STEPCAFControl_DictionaryOfExternFile_0.cxx
|
||||
STEPCAFControl_ExternFile.cxx
|
||||
STEPCAFControl_ExternFile.hxx
|
||||
STEPCAFControl_ExternFile.lxx
|
||||
STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx
|
||||
STEPCAFControl_IteratorOfDictionaryOfExternFile_0.cxx
|
||||
STEPCAFControl_Reader.cxx
|
||||
STEPCAFControl_Reader.hxx
|
||||
STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx
|
||||
STEPCAFControl_StackItemOfDictionaryOfExternFile_0.cxx
|
||||
STEPCAFControl_Writer.cxx
|
||||
STEPCAFControl_Writer.hxx
|
||||
STEPCAFControl_GDTProperty.hxx
|
||||
|
@@ -1,209 +0,0 @@
|
||||
// Created on: 2000-04-09
|
||||
// Created by: Sergey MOZOKHIN
|
||||
// Copyright (c) 2000-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 _STEPCAFControl_DictionaryOfExternFile_HeaderFile
|
||||
#define _STEPCAFControl_DictionaryOfExternFile_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Character.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Size.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class STEPCAFControl_ExternFile;
|
||||
class Standard_NoSuchObject;
|
||||
class STEPCAFControl_IteratorOfDictionaryOfExternFile;
|
||||
class STEPCAFControl_StackItemOfDictionaryOfExternFile;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class STEPCAFControl_DictionaryOfExternFile;
|
||||
DEFINE_STANDARD_HANDLE(STEPCAFControl_DictionaryOfExternFile, MMgt_TShared)
|
||||
|
||||
|
||||
class STEPCAFControl_DictionaryOfExternFile : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a Dictionary cell.
|
||||
//! A Dictionary is always created then handled by its first cell
|
||||
//! After creating a Dictionary, user can call methods HasItem,
|
||||
//! Item, SetItem ... (internal cells and entries are also
|
||||
//! defined as objects from the same class)
|
||||
//! Also iteration can be made, by an Iterator on this Dictionary
|
||||
Standard_EXPORT STEPCAFControl_DictionaryOfExternFile();
|
||||
|
||||
//! Returns True if an Item is bound to a Name in the Dictionnary
|
||||
//! <exact> : if True, commands exact matching
|
||||
//! if False, accept completion, only if ONE AND ONLY ONE
|
||||
//! Dictionnary Entry has <name> as beginning of its name
|
||||
Standard_EXPORT Standard_Boolean HasItem (const Standard_CString name, const Standard_Boolean exact = Standard_False) const;
|
||||
|
||||
//! Works as above method but accepts a String from TCollection
|
||||
Standard_EXPORT Standard_Boolean HasItem (const TCollection_AsciiString& name, const Standard_Boolean exact = Standard_True) const;
|
||||
|
||||
//! Returns item bound to a name in the Dictionnary
|
||||
//! <exact> : same as for HasItem
|
||||
Standard_EXPORT const Handle(STEPCAFControl_ExternFile)& Item (const Standard_CString name, const Standard_Boolean exact = Standard_True) const;
|
||||
|
||||
//! Works as above method but accepts a String from TCollection
|
||||
Standard_EXPORT const Handle(STEPCAFControl_ExternFile)& Item (const TCollection_AsciiString& name, const Standard_Boolean exact = Standard_True) const;
|
||||
|
||||
//! Gathers HasItem and Item, in a less regular but faster way
|
||||
//! If return is True, <anitem> is returned too, else it is not
|
||||
//! <exact> : same as for HasItem
|
||||
Standard_EXPORT Standard_Boolean GetItem (const Standard_CString name, Handle(STEPCAFControl_ExternFile)& anitem, const Standard_Boolean exact = Standard_True) const;
|
||||
|
||||
//! Works as above method but accepts a String from TCollection
|
||||
Standard_EXPORT Standard_Boolean GetItem (const TCollection_AsciiString& name, Handle(STEPCAFControl_ExternFile)& anitem, const Standard_Boolean exact = Standard_True) const;
|
||||
|
||||
//! Binds an item to a dictionnary entry
|
||||
//! If <name> is already known in the dictionary, its value
|
||||
//! is changed. Else, the dictionary entry is created.
|
||||
//! If <exact> is given False, completion is tried, it is accepted
|
||||
//! If it gives a UNIQUE entry : hence this one will be modified
|
||||
//! Else, new entry is created with the exact name given
|
||||
Standard_EXPORT void SetItem (const Standard_CString name, const Handle(STEPCAFControl_ExternFile)& anitem, const Standard_Boolean exact = Standard_True);
|
||||
|
||||
//! Works as above method but accepts a String from TCollection
|
||||
Standard_EXPORT void SetItem (const TCollection_AsciiString& name, const Handle(STEPCAFControl_ExternFile)& anitem, const Standard_Boolean exact = Standard_True);
|
||||
|
||||
//! Returns the Item AS AN ADDRESS which corresponds to a Name,
|
||||
//! in order to be changed or set.
|
||||
//! If this name is not yet recorded, the Dictionary creates it.
|
||||
//! <isvalued> is returned True if the Item is recorded in the
|
||||
//! Dictionary, False else, in that case the Item is reserved and
|
||||
//! the name is noted as beeing valued now.
|
||||
Standard_EXPORT Handle(STEPCAFControl_ExternFile)& NewItem (const Standard_CString name, Standard_Boolean& isvalued, const Standard_Boolean exact = Standard_True);
|
||||
|
||||
//! Works as above method but accepts a String from TCollection
|
||||
Standard_EXPORT Handle(STEPCAFControl_ExternFile)& NewItem (const TCollection_AsciiString& name, Standard_Boolean& isvalued, const Standard_Boolean exact = Standard_True);
|
||||
|
||||
//! Removes a dictionary entry given by its name then Returns True
|
||||
//! If the entry does not exists, Does nothing then Returns False
|
||||
//! <exact> : as for HasItem, if completion works, the found entry
|
||||
//! is removed (else returned value is False)
|
||||
//! <cln> commands cleaning dictionary (to recover memory space)
|
||||
//! For an isolated call, it is recommanded to give it at True
|
||||
//! For a sequence of calls, rather give False, then call Clean
|
||||
Standard_EXPORT Standard_Boolean RemoveItem (const Standard_CString name, const Standard_Boolean cln = Standard_True, const Standard_Boolean exact = Standard_True);
|
||||
|
||||
//! Works as above method but accepts a String from TCollection
|
||||
Standard_EXPORT Standard_Boolean RemoveItem (const TCollection_AsciiString& name, const Standard_Boolean cln = Standard_True, const Standard_Boolean exact = Standard_True);
|
||||
|
||||
//! Deletes physically in one step the entries which were removed
|
||||
//! (can be used for a more efficient Memory Management : first
|
||||
//! Remove several Items (<cln> = False), then Clean the Memory)
|
||||
Standard_EXPORT void Clean();
|
||||
|
||||
//! Returns True if no Item is recorded
|
||||
Standard_EXPORT Standard_Boolean IsEmpty() const;
|
||||
|
||||
//! Clears all the Dictionary : all recorded Items are removed
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
//! Copies the Dictionary as a Tree, without Copying the Items
|
||||
Standard_EXPORT Handle(STEPCAFControl_DictionaryOfExternFile) Copy() const;
|
||||
|
||||
//! Internal routine used for completion (returns True if success)
|
||||
Standard_EXPORT Standard_Boolean Complete (Handle(STEPCAFControl_DictionaryOfExternFile)& acell) const;
|
||||
|
||||
|
||||
friend class STEPCAFControl_IteratorOfDictionaryOfExternFile;
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(STEPCAFControl_DictionaryOfExternFile,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Defines cell's character (internal use, to build dict. tree)
|
||||
Standard_EXPORT void SetChar (const Standard_Character car);
|
||||
|
||||
//! Returns True if this cell has a subcell
|
||||
Standard_EXPORT Standard_Boolean HasSub() const;
|
||||
|
||||
//! Returns subcell
|
||||
Standard_EXPORT Handle(STEPCAFControl_DictionaryOfExternFile) Sub() const;
|
||||
|
||||
//! Returns True if this cell has a next cell
|
||||
Standard_EXPORT Standard_Boolean HasNext() const;
|
||||
|
||||
//! Returns next cell
|
||||
Standard_EXPORT Handle(STEPCAFControl_DictionaryOfExternFile) Next() const;
|
||||
|
||||
//! Defines subcell
|
||||
Standard_EXPORT void SetSub (const Handle(STEPCAFControl_DictionaryOfExternFile)& acell);
|
||||
|
||||
//! Defines next cell
|
||||
Standard_EXPORT void SetNext (const Handle(STEPCAFControl_DictionaryOfExternFile)& acell);
|
||||
|
||||
//! Internal method used to get an entry from a given name
|
||||
Standard_EXPORT void SearchCell (const Standard_CString name, const Standard_Size lmax, const Standard_Character car, const Standard_Size level, Handle(STEPCAFControl_DictionaryOfExternFile)& acell, Standard_Size& reslev, Standard_Integer& stat) const;
|
||||
|
||||
//! Internal method used to create a new entry for a name
|
||||
Standard_EXPORT void NewCell (const Standard_CString name, const Standard_Size namlen, Handle(STEPCAFControl_DictionaryOfExternFile)& acell, const Standard_Size reslev, const Standard_Integer stat);
|
||||
|
||||
//! Returns True if a cell has an associated item value
|
||||
Standard_EXPORT Standard_Boolean HasIt() const;
|
||||
|
||||
//! Returns item value associated to a cell
|
||||
Standard_EXPORT const Handle(STEPCAFControl_ExternFile)& It() const;
|
||||
|
||||
//! Returns item address associated to a cell
|
||||
Standard_EXPORT Handle(STEPCAFControl_ExternFile)& ItAdr();
|
||||
|
||||
//! Binds an item value to a cell
|
||||
Standard_EXPORT void SetIt (const Handle(STEPCAFControl_ExternFile)& anitem);
|
||||
|
||||
//! Declares a cell as Valued : used by NewItem (when an Item
|
||||
//! is created if it did not exist and is returned)
|
||||
Standard_EXPORT void DeclIt();
|
||||
|
||||
//! Removes item bound to a cell (cancels effect of DeclIt)
|
||||
Standard_EXPORT void RemoveIt();
|
||||
|
||||
//! Returns cell's character as a node feature
|
||||
Standard_EXPORT Standard_Character CellChar() const;
|
||||
|
||||
//! Performs Copy from an original <fromcell> to <me>
|
||||
//! Called by Copy
|
||||
Standard_EXPORT void GetCopied (const Handle(STEPCAFControl_DictionaryOfExternFile)& fromcell);
|
||||
|
||||
Standard_Character thecars[4];
|
||||
Handle(STEPCAFControl_DictionaryOfExternFile) thesub;
|
||||
Handle(STEPCAFControl_DictionaryOfExternFile) thenext;
|
||||
Handle(STEPCAFControl_ExternFile) theitem;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _STEPCAFControl_DictionaryOfExternFile_HeaderFile
|
@@ -1,47 +0,0 @@
|
||||
// Created on: 2000-04-09
|
||||
// Created by: Sergey MOZOKHIN
|
||||
// Copyright (c) 2000-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 <STEPCAFControl_DictionaryOfExternFile.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <STEPCAFControl_DictionaryOfExternFile.hxx>
|
||||
#include <STEPCAFControl_ExternFile.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx>
|
||||
#include <STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define TheItem Handle(STEPCAFControl_ExternFile)
|
||||
#define TheItem_hxx <STEPCAFControl_ExternFile.hxx>
|
||||
#define Dico_Iterator STEPCAFControl_IteratorOfDictionaryOfExternFile
|
||||
#define Dico_Iterator_hxx <STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx>
|
||||
#define Dico_StackItem STEPCAFControl_StackItemOfDictionaryOfExternFile
|
||||
#define Dico_StackItem_hxx <STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx>
|
||||
#define Handle_Dico_StackItem Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile)
|
||||
#define Dico_Dictionary STEPCAFControl_DictionaryOfExternFile
|
||||
#define Dico_Dictionary_hxx <STEPCAFControl_DictionaryOfExternFile.hxx>
|
||||
#define Handle_Dico_Dictionary Handle(STEPCAFControl_DictionaryOfExternFile)
|
||||
#include <Dico_Dictionary.gxx>
|
||||
|
@@ -1,103 +0,0 @@
|
||||
// Created on: 2000-04-09
|
||||
// Created by: Sergey MOZOKHIN
|
||||
// Copyright (c) 2000-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 _STEPCAFControl_IteratorOfDictionaryOfExternFile_HeaderFile
|
||||
#define _STEPCAFControl_IteratorOfDictionaryOfExternFile_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
class STEPCAFControl_DictionaryOfExternFile;
|
||||
class STEPCAFControl_StackItemOfDictionaryOfExternFile;
|
||||
class Standard_NoSuchObject;
|
||||
class STEPCAFControl_ExternFile;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
|
||||
class STEPCAFControl_IteratorOfDictionaryOfExternFile
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates an iterator which will work on all the dictionary
|
||||
Standard_EXPORT STEPCAFControl_IteratorOfDictionaryOfExternFile(const Handle(STEPCAFControl_DictionaryOfExternFile)& acell);
|
||||
|
||||
//! Creates an iterator which will consider only entries
|
||||
//! which name begin by the string given as basename (subpart)
|
||||
Standard_EXPORT STEPCAFControl_IteratorOfDictionaryOfExternFile(const Handle(STEPCAFControl_DictionaryOfExternFile)& acell, const Standard_CString basename);
|
||||
|
||||
//! Creates an iterator which will consider only entries
|
||||
//! which name begin by the string given as basename (subpart)
|
||||
//! Same as above, but basename is String instead of CString
|
||||
Standard_EXPORT STEPCAFControl_IteratorOfDictionaryOfExternFile(const Handle(STEPCAFControl_DictionaryOfExternFile)& acell, const TCollection_AsciiString& basename);
|
||||
|
||||
//! Allows to Start a new Iteration from beginning
|
||||
Standard_EXPORT void Start();
|
||||
|
||||
//! Returns True if there are more entries to return
|
||||
Standard_EXPORT Standard_Boolean More();
|
||||
|
||||
//! Go to the next entry
|
||||
//! (if there is not, Value will raise an exception)
|
||||
Standard_EXPORT void Next();
|
||||
|
||||
//! Returns item value of current entry
|
||||
Standard_EXPORT const Handle(STEPCAFControl_ExternFile)& Value() const;
|
||||
|
||||
//! Returns name of current entry
|
||||
Standard_EXPORT TCollection_AsciiString Name() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Appends a new value to the Iteration Stack
|
||||
Standard_EXPORT void AppendStack (const Handle(STEPCAFControl_DictionaryOfExternFile)& val);
|
||||
|
||||
|
||||
Handle(STEPCAFControl_DictionaryOfExternFile) thebase;
|
||||
TCollection_AsciiString thename;
|
||||
Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile) thelast;
|
||||
Standard_Integer thenb;
|
||||
Standard_Boolean themore;
|
||||
Standard_Boolean theinit;
|
||||
Standard_Boolean thenext;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _STEPCAFControl_IteratorOfDictionaryOfExternFile_HeaderFile
|
@@ -1,36 +0,0 @@
|
||||
// Created on: 2000-04-09
|
||||
// Created by: Sergey MOZOKHIN
|
||||
// Copyright (c) 2000-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 <STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx>
|
||||
|
||||
#include <STEPCAFControl_DictionaryOfExternFile.hxx>
|
||||
#include <STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <STEPCAFControl_ExternFile.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
|
||||
#define TheItem Handle(STEPCAFControl_ExternFile)
|
||||
#define TheItem_hxx <STEPCAFControl_ExternFile.hxx>
|
||||
#define Dico_Iterator STEPCAFControl_IteratorOfDictionaryOfExternFile
|
||||
#define Dico_Iterator_hxx <STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx>
|
||||
#define Dico_StackItem STEPCAFControl_StackItemOfDictionaryOfExternFile
|
||||
#define Dico_StackItem_hxx <STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx>
|
||||
#define Handle_Dico_StackItem Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile)
|
||||
#define Dico_Dictionary STEPCAFControl_DictionaryOfExternFile
|
||||
#define Dico_Dictionary_hxx <STEPCAFControl_DictionaryOfExternFile.hxx>
|
||||
#define Handle_Dico_Dictionary Handle(STEPCAFControl_DictionaryOfExternFile)
|
||||
#include <Dico_Iterator.gxx>
|
||||
|
@@ -44,7 +44,6 @@
|
||||
#include <STEPCAFControl_DataMapOfPDExternFile.hxx>
|
||||
#include <STEPCAFControl_DataMapOfSDRExternFile.hxx>
|
||||
#include <STEPCAFControl_DataMapOfShapePD.hxx>
|
||||
#include <STEPCAFControl_DictionaryOfExternFile.hxx>
|
||||
#include <STEPCAFControl_ExternFile.hxx>
|
||||
#include <STEPCAFControl_Reader.hxx>
|
||||
#include <STEPConstruct.hxx>
|
||||
@@ -322,7 +321,6 @@ STEPCAFControl_Reader::STEPCAFControl_Reader ():
|
||||
myMatMode ( Standard_True )
|
||||
{
|
||||
STEPCAFControl_Controller::Init();
|
||||
myFiles = new STEPCAFControl_DictionaryOfExternFile;
|
||||
}
|
||||
|
||||
|
||||
@@ -356,7 +354,7 @@ void STEPCAFControl_Reader::Init (const Handle(XSControl_WorkSession)& WS,
|
||||
{
|
||||
// necessary only in Writer, to set good actor: WS->SelectNorm ( "STEP" );
|
||||
myReader.SetWS (WS,scratch);
|
||||
myFiles = new STEPCAFControl_DictionaryOfExternFile;
|
||||
myFiles.Clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -438,7 +436,7 @@ Standard_Boolean STEPCAFControl_Reader::Perform (const TCollection_AsciiString &
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Handle(STEPCAFControl_DictionaryOfExternFile) &STEPCAFControl_Reader::ExternFiles () const
|
||||
const NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)>& STEPCAFControl_Reader::ExternFiles () const
|
||||
{
|
||||
return myFiles;
|
||||
}
|
||||
@@ -453,9 +451,9 @@ Standard_Boolean STEPCAFControl_Reader::ExternFile (const Standard_CString name,
|
||||
Handle(STEPCAFControl_ExternFile) &ef) const
|
||||
{
|
||||
ef.Nullify();
|
||||
if ( myFiles.IsNull() || ! myFiles->HasItem ( name ) )
|
||||
if ( myFiles.IsEmpty() || !myFiles.IsBound ( name ) )
|
||||
return Standard_False;
|
||||
ef = myFiles->Item ( name );
|
||||
ef = myFiles.Find ( name );
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -800,8 +798,8 @@ Handle(STEPCAFControl_ExternFile) STEPCAFControl_Reader::ReadExternFile (const S
|
||||
Handle(TDocStd_Document)& doc)
|
||||
{
|
||||
// if the file is already read, associate it with SDR
|
||||
if ( myFiles->HasItem ( file, Standard_True ) ) {
|
||||
return myFiles->Item ( file );
|
||||
if ( myFiles.IsBound ( file ) ) {
|
||||
return myFiles.ChangeFind ( file );
|
||||
}
|
||||
|
||||
#ifdef OCCT_DEBUG
|
||||
@@ -829,7 +827,7 @@ Handle(STEPCAFControl_ExternFile) STEPCAFControl_Reader::ReadExternFile (const S
|
||||
}
|
||||
|
||||
// add read file to dictionary
|
||||
myFiles->SetItem ( file, EF );
|
||||
myFiles.Bind( file, EF );
|
||||
|
||||
return EF;
|
||||
}
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#include <STEPCAFControl_DataMapOfPDExternFile.hxx>
|
||||
#include <XCAFDoc_DataMapOfShapeLabel.hxx>
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
class STEPCAFControl_DictionaryOfExternFile;
|
||||
class XSControl_WorkSession;
|
||||
class TDocStd_Document;
|
||||
class TCollection_AsciiString;
|
||||
@@ -104,7 +103,7 @@ public:
|
||||
|
||||
//! Returns data on external files
|
||||
//! Returns Null handle if no external files are read
|
||||
Standard_EXPORT const Handle(STEPCAFControl_DictionaryOfExternFile)& ExternFiles() const;
|
||||
Standard_EXPORT const NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)> & ExternFiles() const;
|
||||
|
||||
//! Returns data on external file by its name
|
||||
//! Returns False if no external file with given name is read
|
||||
@@ -242,7 +241,7 @@ private:
|
||||
|
||||
|
||||
STEPControl_Reader myReader;
|
||||
Handle(STEPCAFControl_DictionaryOfExternFile) myFiles;
|
||||
NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)> myFiles;
|
||||
Standard_Boolean myColorMode;
|
||||
Standard_Boolean myNameMode;
|
||||
Standard_Boolean myLayerMode;
|
||||
|
@@ -1,78 +0,0 @@
|
||||
// Created on: 2000-04-09
|
||||
// Created by: Sergey MOZOKHIN
|
||||
// Copyright (c) 2000-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 _STEPCAFControl_StackItemOfDictionaryOfExternFile_HeaderFile
|
||||
#define _STEPCAFControl_StackItemOfDictionaryOfExternFile_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
class STEPCAFControl_DictionaryOfExternFile;
|
||||
class STEPCAFControl_ExternFile;
|
||||
class STEPCAFControl_IteratorOfDictionaryOfExternFile;
|
||||
|
||||
|
||||
class STEPCAFControl_StackItemOfDictionaryOfExternFile;
|
||||
DEFINE_STANDARD_HANDLE(STEPCAFControl_StackItemOfDictionaryOfExternFile, MMgt_TShared)
|
||||
|
||||
|
||||
class STEPCAFControl_StackItemOfDictionaryOfExternFile : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a StackItem with no Previous one
|
||||
Standard_EXPORT STEPCAFControl_StackItemOfDictionaryOfExternFile();
|
||||
|
||||
//! Creates a StackItem with a Previous one
|
||||
Standard_EXPORT STEPCAFControl_StackItemOfDictionaryOfExternFile(const Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile)& previous);
|
||||
|
||||
//! Returns the Previous Item (is Null if no Previous defined)
|
||||
Standard_EXPORT Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile) Previous() const;
|
||||
|
||||
//! Returns the Dictionary Cell corresponding to an Item
|
||||
Standard_EXPORT Handle(STEPCAFControl_DictionaryOfExternFile) Value() const;
|
||||
|
||||
//! Sets a new Dictionary Cell as Value of an Item
|
||||
Standard_EXPORT void SetValue (const Handle(STEPCAFControl_DictionaryOfExternFile)& cval);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI_INLINE(STEPCAFControl_StackItemOfDictionaryOfExternFile,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(STEPCAFControl_DictionaryOfExternFile) thevalue;
|
||||
Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile) theprev;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _STEPCAFControl_StackItemOfDictionaryOfExternFile_HeaderFile
|
@@ -1,45 +0,0 @@
|
||||
// Created on: 2000-04-09
|
||||
// Created by: Sergey MOZOKHIN
|
||||
// Copyright (c) 2000-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 <STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <STEPCAFControl_DictionaryOfExternFile.hxx>
|
||||
#include <STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx>
|
||||
#include <STEPCAFControl_ExternFile.hxx>
|
||||
#include <STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define TheItem Handle(STEPCAFControl_ExternFile)
|
||||
#define TheItem_hxx <STEPCAFControl_ExternFile.hxx>
|
||||
#define Dico_Iterator STEPCAFControl_IteratorOfDictionaryOfExternFile
|
||||
#define Dico_Iterator_hxx <STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx>
|
||||
#define Dico_StackItem STEPCAFControl_StackItemOfDictionaryOfExternFile
|
||||
#define Dico_StackItem_hxx <STEPCAFControl_StackItemOfDictionaryOfExternFile.hxx>
|
||||
#define Handle_Dico_StackItem Handle(STEPCAFControl_StackItemOfDictionaryOfExternFile)
|
||||
#define Dico_Dictionary STEPCAFControl_DictionaryOfExternFile
|
||||
#define Dico_Dictionary_hxx <STEPCAFControl_DictionaryOfExternFile.hxx>
|
||||
#define Handle_Dico_Dictionary Handle(STEPCAFControl_DictionaryOfExternFile)
|
||||
#include <Dico_StackItem.gxx>
|
||||
|
@@ -47,9 +47,7 @@
|
||||
#include <StepBasic_SiUnitAndPlaneAngleUnit.hxx>
|
||||
#include <STEPCAFControl_ActorWrite.hxx>
|
||||
#include <STEPCAFControl_Controller.hxx>
|
||||
#include <STEPCAFControl_DictionaryOfExternFile.hxx>
|
||||
#include <STEPCAFControl_ExternFile.hxx>
|
||||
#include <STEPCAFControl_IteratorOfDictionaryOfExternFile.hxx>
|
||||
#include <STEPCAFControl_Writer.hxx>
|
||||
#include <STEPConstruct.hxx>
|
||||
#include <STEPConstruct_DataMapOfAsciiStringTransient.hxx>
|
||||
@@ -317,7 +315,7 @@ void STEPCAFControl_Writer::Init (const Handle(XSControl_WorkSession)& WS,
|
||||
{
|
||||
WS->SelectNorm ( "STEP" );
|
||||
myWriter.SetWS (WS,scratch);
|
||||
myFiles = new STEPCAFControl_DictionaryOfExternFile;
|
||||
myFiles.Clear();
|
||||
myLabEF.Clear();
|
||||
myLabels.Clear();
|
||||
}
|
||||
@@ -339,7 +337,7 @@ IFSelect_ReturnStatus STEPCAFControl_Writer::Write (const Standard_CString filen
|
||||
TCollection_AsciiString dpath;
|
||||
mainfile.SystemName ( dpath );
|
||||
|
||||
STEPCAFControl_IteratorOfDictionaryOfExternFile it ( myFiles );
|
||||
NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)>::Iterator it(myFiles);
|
||||
for ( ; it.More(); it.Next() ) {
|
||||
Handle(STEPCAFControl_ExternFile) EF = it.Value();
|
||||
if ( EF->GetWriteStatus() != IFSelect_RetVoid ) continue;
|
||||
@@ -433,7 +431,7 @@ Standard_Boolean STEPCAFControl_Writer::Perform (const Handle(TDocStd_Document)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Handle(STEPCAFControl_DictionaryOfExternFile) &STEPCAFControl_Writer::ExternFiles () const
|
||||
const NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)>& STEPCAFControl_Writer::ExternFiles () const
|
||||
{
|
||||
return myFiles;
|
||||
}
|
||||
@@ -463,9 +461,9 @@ Standard_Boolean STEPCAFControl_Writer::ExternFile (const Standard_CString name,
|
||||
Handle(STEPCAFControl_ExternFile) &ef) const
|
||||
{
|
||||
ef.Nullify();
|
||||
if ( ! myFiles.IsNull() || ! myFiles->HasItem ( name ) )
|
||||
if ( ! myFiles.IsEmpty() || ! myFiles.IsBound ( name ) )
|
||||
return Standard_False;
|
||||
ef = myFiles->Item ( name );
|
||||
ef = myFiles.Find( name );
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -741,13 +739,13 @@ TopoDS_Shape STEPCAFControl_Writer::TransferExternFiles (const TDF_Label &L,
|
||||
GetLabelName ( L, basename );
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString ( basename );
|
||||
name->AssignCat ( ".stp" );
|
||||
if ( myFiles->HasItem ( name->ToCString() ) ) { // avoid confusions
|
||||
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->HasItem ( name->ToCString() ) ) break;
|
||||
name = new TCollection_HAsciiString ( basename );
|
||||
name->AssignCat ( "_" );
|
||||
name->AssignCat ( TCollection_AsciiString ( k ).ToCString() );
|
||||
name->AssignCat ( ".stp" );
|
||||
if ( ! myFiles.IsBound ( name->ToCString() ) ) break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -762,7 +760,7 @@ TopoDS_Shape STEPCAFControl_Writer::TransferExternFiles (const TDF_Label &L,
|
||||
EF->SetTransferStatus ( Transfer ( sw, Lseq, mode, multi, Standard_True ) );
|
||||
Interface_Static::SetIVal ("write.step.assembly", assemblymode);
|
||||
myLabEF.Bind ( L, EF );
|
||||
myFiles->SetItem ( name->ToCString(), EF );
|
||||
myFiles.Bind ( name->ToCString(), EF );
|
||||
|
||||
// return empty compound as replacement for the shape
|
||||
myLabels.Bind ( L, C );
|
||||
|
@@ -29,7 +29,6 @@
|
||||
#include <Standard_CString.hxx>
|
||||
#include <STEPControl_StepModelType.hxx>
|
||||
#include <TDF_LabelSequence.hxx>
|
||||
class STEPCAFControl_DictionaryOfExternFile;
|
||||
class XSControl_WorkSession;
|
||||
class TDocStd_Document;
|
||||
class TDF_Label;
|
||||
@@ -91,7 +90,7 @@ public:
|
||||
|
||||
//! Returns data on external files
|
||||
//! Returns Null handle if no external files are read
|
||||
Standard_EXPORT const Handle(STEPCAFControl_DictionaryOfExternFile)& ExternFiles() const;
|
||||
Standard_EXPORT const NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)>& ExternFiles() const;
|
||||
|
||||
//! Returns data on external file by its original label
|
||||
//! Returns False if no external file with given name is read
|
||||
@@ -197,7 +196,7 @@ private:
|
||||
|
||||
|
||||
STEPControl_Writer myWriter;
|
||||
Handle(STEPCAFControl_DictionaryOfExternFile) myFiles;
|
||||
NCollection_DataMap<TCollection_AsciiString, Handle(STEPCAFControl_ExternFile)> myFiles;
|
||||
STEPCAFControl_DataMapOfLabelShape myLabels;
|
||||
STEPCAFControl_DataMapOfLabelExternFile myLabEF;
|
||||
Standard_Boolean myColorMode;
|
||||
|
Reference in New Issue
Block a user