Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:34

0001 // Created on: 2000-06-15
0002 // Created by: Edward AGAPOV
0003 // Copyright (c) 2000-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _XCAFDoc_ShapeTool_HeaderFile
0017 #define _XCAFDoc_ShapeTool_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 
0021 #include <XCAFDoc_DataMapOfShapeLabel.hxx>
0022 #include <Standard_Boolean.hxx>
0023 #include <TDataStd_NamedData.hxx>
0024 #include <TDataStd_GenericEmpty.hxx>
0025 #include <TDF_LabelMap.hxx>
0026 #include <TDF_LabelSequence.hxx>
0027 #include <Standard_Integer.hxx>
0028 #include <Standard_OStream.hxx>
0029 #include <TColStd_SequenceOfHAsciiString.hxx>
0030 #include <TDF_AttributeSequence.hxx>
0031 #include <TopTools_SequenceOfShape.hxx>
0032 class Standard_GUID;
0033 class TDF_Label;
0034 class TopoDS_Shape;
0035 class TopLoc_Location;
0036 class XCAFDoc_GraphNode;
0037 
0038 
0039 class XCAFDoc_ShapeTool;
0040 DEFINE_STANDARD_HANDLE(XCAFDoc_ShapeTool, TDataStd_GenericEmpty)
0041 
0042 //! A tool to store shapes in an XDE
0043 //! document in the form of assembly structure, and to maintain this structure.
0044 //! Attribute containing Shapes section of DECAF document.
0045 //! Provide tools for management of Shapes section.
0046 //! The API provided by this class allows to work with this
0047 //! structure regardless of its low-level implementation.
0048 //! All the shapes are stored on child labels of a main label which is
0049 //! XCAFDoc_DocumentTool::LabelShapes(). The label for assembly also has
0050 //! sub-labels, each of which represents the instance of
0051 //! another shape in that assembly (component). Such sub-label
0052 //! stores reference to the label of the original shape in the form
0053 //! of TDataStd_TreeNode with GUID XCAFDoc::ShapeRefGUID(), and its
0054 //! location encapsulated into the NamedShape.
0055 //! For correct work with an XDE document, it is necessary to use
0056 //! methods for analysis and methods for working with shapes.
0057 //! For example:
0058 //! if ( STool->IsAssembly(aLabel) )
0059 //! { Standard_Boolean subchilds = Standard_False; (default)
0060 //! Standard_Integer nbc = STool->NbComponents
0061 //! (aLabel[,subchilds]);
0062 //! }
0063 //! If subchilds is True, commands also consider sub-levels. By
0064 //! default, only level one is checked.
0065 //! In this example, number of children from the first level of
0066 //! assembly will be returned. Methods for creation and initialization:
0067 //! Constructor:
0068 //! XCAFDoc_ShapeTool::XCAFDoc_ShapeTool()
0069 //! Getting a guid:
0070 //! Standard_GUID GetID ();
0071 //! Creation (if does not exist) of ShapeTool on label L:
0072 //! Handle(XCAFDoc_ShapeTool) XCAFDoc_ShapeTool::Set(const TDF_Label& L)
0073 //! Analyze whether shape is a simple shape or an instance or a
0074 //! component of an assembly or it is an assembly ( methods of analysis).
0075 //! For example:
0076 //! STool->IsShape(aLabel) ;
0077 //! Analyze that the label represents a shape (simple
0078 //! shape, assembly or reference) or
0079 //! STool->IsTopLevel(aLabel);
0080 //! Analyze that the label is a label of a top-level shape.
0081 //! Work with simple shapes, assemblies and instances (
0082 //! methods for work with shapes).
0083 //! For example:
0084 //! Add shape:
0085 //! Standard_Boolean makeAssembly;
0086 //! // True to interpret a Compound as an Assembly, False to take it
0087 //! as a whole
0088 //! aLabel = STool->AddShape(aShape, makeAssembly);
0089 //! Get shape:
0090 //! TDF_Label aLabel...
0091 //! // A label must be present if
0092 //! (aLabel.IsNull()) { ... no such label : abandon .. }
0093 //! TopoDS_Shape aShape;
0094 //! aShape = STool->GetShape(aLabel);
0095 //! if (aShape.IsNull())
0096 //! { ... this label is not for a Shape ... }
0097 //! To get a label from shape.
0098 //! Standard_Boolean findInstance = Standard_False;
0099 //! (this is default value)
0100 //! aLabel = STool->FindShape(aShape [,findInstance]);
0101 //! if (aLabel.IsNull())
0102 //! { ... no label found for this shape ... }
0103 class XCAFDoc_ShapeTool : public TDataStd_GenericEmpty
0104 {
0105 
0106 public:
0107 
0108   
0109   Standard_EXPORT static const Standard_GUID& GetID();
0110   
0111   //! Create (if not exist) ShapeTool from XCAFDoc on <L>.
0112   Standard_EXPORT static Handle(XCAFDoc_ShapeTool) Set (const TDF_Label& L);
0113   
0114   //! Creates an empty tool
0115   //! Creates a tool to work with a document <Doc>
0116   //! Attaches to label XCAFDoc::LabelShapes()
0117   Standard_EXPORT XCAFDoc_ShapeTool();
0118   
0119   //! Returns True if the label is a label of top-level shape,
0120   //! as opposed to component of assembly or subshape
0121   Standard_EXPORT Standard_Boolean IsTopLevel (const TDF_Label& L) const;
0122   
0123   //! Returns True if the label is not used by any assembly, i.e.
0124   //! contains sublabels which are assembly components
0125   //! This is relevant only if IsShape() is True
0126   //! (There  is  no  Father TreeNode on  this  <L>)
0127   Standard_EXPORT static Standard_Boolean IsFree (const TDF_Label& L);
0128   
0129   //! Returns True if the label represents a shape (simple shape,
0130   //! assembly or reference)
0131   Standard_EXPORT static Standard_Boolean IsShape (const TDF_Label& L);
0132   
0133   //! Returns True if the label is a label of simple shape
0134   Standard_EXPORT static Standard_Boolean IsSimpleShape (const TDF_Label& L);
0135   
0136   //! Return true if <L> is a located instance of other shape
0137   //! i.e. reference
0138   Standard_EXPORT static Standard_Boolean IsReference (const TDF_Label& L);
0139   
0140   //! Returns True if the label is a label of assembly, i.e.
0141   //! contains sublabels which are assembly components
0142   //! This is relevant only if IsShape() is True
0143   Standard_EXPORT static Standard_Boolean IsAssembly (const TDF_Label& L);
0144   
0145   //! Return true if <L> is reference serving as component
0146   //! of assembly
0147   Standard_EXPORT static Standard_Boolean IsComponent (const TDF_Label& L);
0148   
0149   //! Returns True if the label is a label of compound, i.e.
0150   //! contains some sublabels
0151   //! This is relevant only if IsShape() is True
0152   Standard_EXPORT static Standard_Boolean IsCompound (const TDF_Label& L);
0153   
0154   //! Return true if <L> is subshape of the top-level shape
0155   Standard_EXPORT static Standard_Boolean IsSubShape (const TDF_Label& L);
0156   
0157   //! Checks whether shape <sub> is subshape of shape stored on
0158   //! label shapeL
0159   Standard_EXPORT Standard_Boolean IsSubShape (const TDF_Label& shapeL, const TopoDS_Shape& sub) const;
0160   
0161   Standard_EXPORT Standard_Boolean SearchUsingMap (const TopoDS_Shape& S, TDF_Label& L, const Standard_Boolean findWithoutLoc, const Standard_Boolean findSubshape) const;
0162   
0163   //! General tool to find a (sub) shape in the document
0164   //! * If findInstance is True, and S has a non-null location,
0165   //! first tries to find the shape among the top-level shapes
0166   //! with this location
0167   //! * If not found, and findComponent is True, tries to find the shape
0168   //! among the components of assemblies
0169   //! * If not found, tries to find the shape without location
0170   //! among top-level shapes
0171   //! * If not found and findSubshape is True, tries to find a
0172   //! shape as a subshape of top-level simple shapes
0173   //! Returns False if nothing is found
0174   Standard_EXPORT Standard_Boolean Search (const TopoDS_Shape& S, TDF_Label& L, const Standard_Boolean findInstance = Standard_True, const Standard_Boolean findComponent = Standard_True, const Standard_Boolean findSubshape = Standard_True) const;
0175   
0176   //! Returns the label corresponding to shape S
0177   //! (searches among top-level shapes, not including subcomponents
0178   //! of assemblies and subshapes)
0179   //! If findInstance is False (default), search for the
0180   //! input shape without location
0181   //! If findInstance is True, searches for the
0182   //! input shape as is.
0183   //! Return True if <S> is found.
0184   Standard_EXPORT Standard_Boolean FindShape (const TopoDS_Shape& S, TDF_Label& L, const Standard_Boolean findInstance = Standard_False) const;
0185   
0186   //! Does the same as previous method
0187   //! Returns Null label if not found
0188   Standard_EXPORT TDF_Label FindShape (const TopoDS_Shape& S, const Standard_Boolean findInstance = Standard_False) const;
0189   
0190   //! To get TopoDS_Shape from shape's label
0191   //! For component, returns new shape with correct location
0192   //! Returns False if label does not contain shape
0193   Standard_EXPORT static Standard_Boolean GetShape (const TDF_Label& L, TopoDS_Shape& S);
0194   
0195   //! To get TopoDS_Shape from shape's label
0196   //! For component, returns new shape with correct location
0197   //! Returns Null shape if label does not contain shape
0198   Standard_EXPORT static TopoDS_Shape GetShape (const TDF_Label& L);
0199 
0200   //! Gets shape from a sequence of shape's labels
0201   //! @param[in] theLabels a sequence of labels to get shapes from
0202   //! @return original shape in case of one label and a compound of shapes in case of more
0203   Standard_EXPORT static TopoDS_Shape GetOneShape(const TDF_LabelSequence& theLabels);
0204 
0205   //! Gets shape from a sequence of all top-level shapes which are free
0206   //! @return original shape in case of one label and a compound of shapes in case of more
0207   Standard_EXPORT TopoDS_Shape GetOneShape() const;
0208   
0209   //! Creates new (empty) top-level shape.
0210   //! Initially it holds empty TopoDS_Compound
0211   Standard_EXPORT TDF_Label NewShape() const;
0212   
0213   //! Sets representation (TopoDS_Shape) for top-level shape.
0214   Standard_EXPORT void SetShape (const TDF_Label& L, const TopoDS_Shape& S);
0215   
0216   //! Adds a new top-level (creates and returns a new label)
0217   //! If makeAssembly is True, treats TopAbs_COMPOUND shapes
0218   //! as assemblies (creates assembly structure).
0219   //! NOTE: <makePrepare> replace components without location
0220   //! in assembly by located components to avoid some problems.
0221   //! If AutoNaming() is True then automatically attaches names.
0222   Standard_EXPORT TDF_Label AddShape (const TopoDS_Shape& S, const Standard_Boolean makeAssembly = Standard_True, const Standard_Boolean makePrepare = Standard_True);
0223   
0224   //! Removes shape (whole label and all its sublabels)
0225   //! If removeCompletely is true, removes complete shape
0226   //! If removeCompletely is false, removes instance(location) only
0227   //! Returns False (and does nothing) if shape is not free
0228   //! or is not top-level shape
0229   Standard_EXPORT Standard_Boolean RemoveShape (const TDF_Label& L, const Standard_Boolean removeCompletely = Standard_True) const;
0230   
0231   //! set hasComponents into false
0232   Standard_EXPORT void Init();
0233   
0234   //! Sets auto-naming mode to <V>. If True then for added
0235   //! shapes, links, assemblies and SHUO's, the TDataStd_Name attribute
0236   //! is automatically added. For shapes it contains a shape type
0237   //! (e.g. "SOLID", "SHELL", etc); for links it has a form
0238   //! "=>[0:1:1:2]" (where a tag is a label containing a shape
0239   //! without a location); for assemblies it is "ASSEMBLY", and
0240   //! "SHUO" for SHUO's.
0241   //! This setting is global; it cannot be made a member function
0242   //! as it is used by static methods as well.
0243   //! By default, auto-naming is enabled.
0244   //! See also AutoNaming().
0245   Standard_EXPORT static void SetAutoNaming (const Standard_Boolean V);
0246   
0247   //! Returns current auto-naming mode. See SetAutoNaming() for
0248   //! description.
0249   Standard_EXPORT static Standard_Boolean AutoNaming();
0250   
0251   //! recursive
0252   Standard_EXPORT void ComputeShapes (const TDF_Label& L);
0253   
0254   //! Compute a sequence of simple shapes
0255   Standard_EXPORT void ComputeSimpleShapes();
0256   
0257   //! Returns a sequence of all top-level shapes
0258   Standard_EXPORT void GetShapes (TDF_LabelSequence& Labels) const;
0259   
0260   //! Returns a sequence of all top-level shapes
0261   //! which are free (i.e. not referred by any other)
0262   Standard_EXPORT void GetFreeShapes (TDF_LabelSequence& FreeLabels) const;
0263   
0264   //! Returns list of labels which refer shape L as component
0265   //! Returns number of users (0 if shape is free)
0266   Standard_EXPORT static Standard_Integer GetUsers (const TDF_Label& L, TDF_LabelSequence& Labels, const Standard_Boolean getsubchilds = Standard_False);
0267   
0268   //! Returns location of instance
0269   Standard_EXPORT static TopLoc_Location GetLocation (const TDF_Label& L);
0270   
0271   //! Returns label which corresponds to a shape referred by L
0272   //! Returns False if label is not reference
0273   Standard_EXPORT static Standard_Boolean GetReferredShape (const TDF_Label& L, TDF_Label& Label);
0274   
0275   //! Returns number of Assembles components
0276   Standard_EXPORT static Standard_Integer NbComponents (const TDF_Label& L, const Standard_Boolean getsubchilds = Standard_False);
0277   
0278   //! Returns list of components of assembly
0279   //! Returns False if label is not assembly
0280   Standard_EXPORT static Standard_Boolean GetComponents (const TDF_Label& L, TDF_LabelSequence& Labels, const Standard_Boolean getsubchilds = Standard_False);
0281   
0282   //! Adds a component given by its label and location to the assembly
0283   //! Note: assembly must be IsAssembly() or IsSimpleShape()
0284   Standard_EXPORT TDF_Label AddComponent (const TDF_Label& assembly, const TDF_Label& comp, const TopLoc_Location& Loc);
0285   
0286   //! Adds a shape (located) as a component to the assembly
0287   //! If necessary, creates an additional top-level shape for
0288   //! component and return the Label of component.
0289   //! If expand is True and component is Compound, it will
0290   //! be created as assembly also
0291   //! Note: assembly must be IsAssembly() or IsSimpleShape()
0292   Standard_EXPORT TDF_Label AddComponent (const TDF_Label& assembly, const TopoDS_Shape& comp, const Standard_Boolean expand = Standard_False);
0293   
0294   //! Removes a component from its assembly
0295   Standard_EXPORT void RemoveComponent (const TDF_Label& comp) const;
0296   
0297   //! Top-down update for all assembly compounds stored in the document.
0298   Standard_EXPORT void UpdateAssemblies();
0299   
0300   //! Finds a label for subshape <sub> of shape stored on
0301   //! label shapeL
0302   //! Returns Null label if it is not found
0303   Standard_EXPORT Standard_Boolean FindSubShape (const TDF_Label& shapeL, const TopoDS_Shape& sub, TDF_Label& L) const;
0304   
0305   //! Adds a label for subshape <sub> of shape stored on
0306   //! label shapeL
0307   //! Returns Null label if it is not subshape
0308   Standard_EXPORT TDF_Label AddSubShape (const TDF_Label& shapeL, const TopoDS_Shape& sub) const;
0309 
0310   //! Adds (of finds already existed) a label for subshape <sub> of shape stored on
0311   //! label shapeL. Label addedSubShapeL returns added (found) label or empty in case of wrong subshape.
0312   //! Returns True, if new shape was added, False in case of already existed subshape/wrong subshape
0313   Standard_EXPORT Standard_Boolean AddSubShape(const TDF_Label& shapeL, const TopoDS_Shape& sub, TDF_Label& addedSubShapeL) const;
0314   
0315   Standard_EXPORT TDF_Label FindMainShapeUsingMap (const TopoDS_Shape& sub) const;
0316   
0317   //! Performs a search among top-level shapes to find
0318   //! the shape containing <sub> as subshape
0319   //! Checks only simple shapes, and returns the first found
0320   //! label (which should be the only one for valid model)
0321   Standard_EXPORT TDF_Label FindMainShape (const TopoDS_Shape& sub) const;
0322   
0323   //! Returns list of labels identifying subshapes of the given shape
0324   //! Returns False if no subshapes are placed on that label
0325   Standard_EXPORT static Standard_Boolean GetSubShapes (const TDF_Label& L, TDF_LabelSequence& Labels);
0326   
0327   //! returns the label under which shapes are stored
0328   Standard_EXPORT TDF_Label BaseLabel() const;
0329   
0330   Standard_EXPORT Standard_OStream& Dump (Standard_OStream& theDumpLog, const Standard_Boolean deep) const;
0331 
0332   Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& theDumpLog) const Standard_OVERRIDE;
0333 
0334   //! Print to std::ostream <theDumpLog> type of shape found on <L> label
0335   //! and the entry of <L>, with <level> tabs before.
0336   //! If <deep>, print also TShape and Location addresses
0337   Standard_EXPORT static void DumpShape (Standard_OStream& theDumpLog, const TDF_Label& L, const Standard_Integer level = 0, const Standard_Boolean deep = Standard_False);
0338   
0339   Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
0340   
0341   //! Returns True if the label is a label of external references, i.e.
0342   //! there are some reference on the no-step files, which are
0343   //! described in document only their names
0344   Standard_EXPORT static Standard_Boolean IsExternRef (const TDF_Label& L);
0345   
0346   //! Sets the names of references on the no-step files
0347   Standard_EXPORT TDF_Label SetExternRefs (const TColStd_SequenceOfHAsciiString& SHAS) const;
0348   
0349   //! Sets the names of references on the no-step files
0350   Standard_EXPORT void SetExternRefs (const TDF_Label& L, const TColStd_SequenceOfHAsciiString& SHAS) const;
0351   
0352   //! Gets the names of references on the no-step files
0353   Standard_EXPORT static void GetExternRefs (const TDF_Label& L, TColStd_SequenceOfHAsciiString& SHAS);
0354   
0355   //! Sets the SHUO structure between upper_usage and next_usage
0356   //! create multy-level (if number of labels > 2) SHUO from first to last
0357   //! Initialise out <MainSHUOAttr> by main upper_usage SHUO attribute.
0358   //! Returns FALSE if some of labels in not component label
0359   Standard_EXPORT Standard_Boolean SetSHUO (const TDF_LabelSequence& Labels, Handle(XCAFDoc_GraphNode)& MainSHUOAttr) const;
0360   
0361   //! Returns founded SHUO GraphNode attribute <aSHUOAttr>
0362   //! Returns false in other case
0363   Standard_EXPORT static Standard_Boolean GetSHUO (const TDF_Label& SHUOLabel, Handle(XCAFDoc_GraphNode)& aSHUOAttr);
0364   
0365   //! Returns founded SHUO GraphNodes of indicated component
0366   //! Returns false in other case
0367   Standard_EXPORT static Standard_Boolean GetAllComponentSHUO (const TDF_Label& CompLabel, TDF_AttributeSequence& SHUOAttrs);
0368   
0369   //! Returns the sequence of labels of SHUO attributes,
0370   //! which is upper_usage for this next_usage SHUO attribute
0371   //! (that indicated by label)
0372   //! NOTE: returns upper_usages only on one level (not recurse)
0373   //! NOTE: do not clear the sequence before filling
0374   Standard_EXPORT static Standard_Boolean GetSHUOUpperUsage (const TDF_Label& NextUsageL, TDF_LabelSequence& Labels);
0375   
0376   //! Returns the sequence of labels of SHUO attributes,
0377   //! which is next_usage for this upper_usage SHUO attribute
0378   //! (that indicated by label)
0379   //! NOTE: returns next_usages only on one level (not recurse)
0380   //! NOTE: do not clear the sequence before filling
0381   Standard_EXPORT static Standard_Boolean GetSHUONextUsage (const TDF_Label& UpperUsageL, TDF_LabelSequence& Labels);
0382   
0383   //! Remove SHUO from component sublabel,
0384   //! remove all dependencies on other SHUO.
0385   //! Returns FALSE if cannot remove SHUO dependencies.
0386   //! NOTE: remove any styles that associated with this SHUO.
0387   Standard_EXPORT Standard_Boolean RemoveSHUO (const TDF_Label& SHUOLabel) const;
0388   
0389   //! Search the path of labels in the document,
0390   //! that corresponds the component from any assembly
0391   //! Try to search the sequence of labels with location that
0392   //! produce this shape as component of any assembly
0393   //! NOTE: Clear sequence of labels before filling
0394   Standard_EXPORT Standard_Boolean FindComponent (const TopoDS_Shape& theShape, TDF_LabelSequence& Labels) const;
0395   
0396   //! Search for the component shape that styled by shuo
0397   //! Returns null shape if no any shape is found.
0398   Standard_EXPORT TopoDS_Shape GetSHUOInstance (const Handle(XCAFDoc_GraphNode)& theSHUO) const;
0399   
0400   //! Search for the component shape by labelks path
0401   //! and set SHUO structure for founded label structure
0402   //! Returns null attribute if no component in any assembly found.
0403   Standard_EXPORT Handle(XCAFDoc_GraphNode) SetInstanceSHUO (const TopoDS_Shape& theShape) const;
0404   
0405   //! Searching for component shapes that styled by shuo
0406   //! Returns empty sequence of shape if no any shape is found.
0407   Standard_EXPORT Standard_Boolean GetAllSHUOInstances (const Handle(XCAFDoc_GraphNode)& theSHUO, TopTools_SequenceOfShape& theSHUOShapeSeq) const;
0408   
0409   //! Searches the SHUO by labels of components
0410   //! from upper_usage component to next_usage
0411   //! Returns null attribute if no SHUO found
0412   Standard_EXPORT static Standard_Boolean FindSHUO (const TDF_LabelSequence& Labels, Handle(XCAFDoc_GraphNode)& theSHUOAttr);
0413 
0414   //! Sets location to the shape label
0415   //! If label is reference -> changes location attribute
0416   //! If label is free shape -> creates reference with location to it
0417   //! @param[in] theShapeLabel the shape label to change location
0418   //! @param[in] theLoc location to set
0419   //! @param[out] theRefLabel the reference label with new location
0420   //! @return TRUE if new location was set
0421   Standard_EXPORT Standard_Boolean SetLocation (const TDF_Label& theShapeLabel, const TopLoc_Location& theLoc, TDF_Label& theRefLabel);
0422   
0423   //! Convert Shape (compound/compsolid/shell/wire) to assembly
0424   Standard_EXPORT Standard_Boolean Expand (const TDF_Label& Shape);
0425 
0426   //! Method to get NamedData attribute assigned to the given shape label.
0427   //! @param theLabel    [in] the shape Label
0428   //! @param theToCreate [in] create and assign attribute if it doesn't exist
0429   //! @return Handle to the NamedData attribute or Null if there is none
0430   Standard_EXPORT Handle(TDataStd_NamedData) GetNamedProperties (const TDF_Label& theLabel, const Standard_Boolean theToCreate = Standard_False) const;
0431 
0432   //! Method to get NamedData attribute assigned to a label of the given shape.
0433   //! @param theShape    [in] input shape
0434   //! @param theToCreate [in] create and assign attribute if it doesn't exist
0435   //! @return Handle to the NamedData attribute or Null if there is none
0436   Standard_EXPORT Handle(TDataStd_NamedData) GetNamedProperties(const TopoDS_Shape& theShape, const Standard_Boolean theToCreate = Standard_False) const;
0437   
0438   //! Dumps the content of me into the stream
0439   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0440 
0441 
0442   DEFINE_DERIVED_ATTRIBUTE(XCAFDoc_ShapeTool,TDataStd_GenericEmpty)
0443 
0444 
0445 private:
0446 
0447   //! Checks recursively if the given assembly item is modified. If so, its
0448   //! associated compound is updated. Returns true if the assembly item is
0449   //! modified, false -- otherwise.
0450   Standard_EXPORT Standard_Boolean updateComponent(const TDF_Label& theAssmLabel,
0451                                                    TopoDS_Shape&    theUpdatedShape,
0452                                                    TDF_LabelMap&    theUpdated) const;
0453 
0454   //! Adds a new top-level (creates and returns a new label)
0455   //! For internal use. Used by public method AddShape.
0456   Standard_EXPORT TDF_Label addShape (const TopoDS_Shape& S, const Standard_Boolean makeAssembly = Standard_True);
0457   
0458   //! Makes a shape on label L to be a reference to shape refL
0459   //! with location loc
0460   Standard_EXPORT static void MakeReference (const TDF_Label& L, const TDF_Label& refL, const TopLoc_Location& loc);
0461 
0462   //! Auxiliary method for Expand
0463   //! Add declared under expanded theMainShapeL subshapes to new part label thePart
0464   //! Recursively iterate all subshapes of shape from thePart, current shape to iterate its subshapes is theShape.
0465   Standard_EXPORT void makeSubShape(const TDF_Label& theMainShapeL, const TDF_Label& thePart, const TopoDS_Shape& theShape, const TopLoc_Location& theLoc);
0466 
0467   XCAFDoc_DataMapOfShapeLabel myShapeLabels;
0468   XCAFDoc_DataMapOfShapeLabel mySubShapes;
0469   XCAFDoc_DataMapOfShapeLabel mySimpleShapes;
0470   Standard_Boolean hasSimpleShapes;
0471 
0472 
0473 };
0474 
0475 
0476 
0477 
0478 
0479 
0480 
0481 #endif // _XCAFDoc_ShapeTool_HeaderFile