mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-08 14:17:06 +03:00
0024002: Overall code and build procedure refactoring -- automatic
Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl": - WOK-generated header files from inc and sources from drv are moved to src - CDL files removed - All packages are converted to nocdlpack
This commit is contained in:
@@ -1,14 +1,77 @@
|
||||
TNaming_NCollections.hxx
|
||||
TNaming_NamedShapeHasher.hxx
|
||||
TNaming_MapOfNamedShape.hxx
|
||||
TNaming_MapIteratorOfMapOfNamedShape.hxx
|
||||
TNaming_ListOfNamedShape.hxx
|
||||
TNaming_ListIteratorOfListOfNamedShape.hxx
|
||||
TNaming_DataMapOfShapePtrRefShape.hxx
|
||||
TNaming.cxx
|
||||
TNaming.hxx
|
||||
TNaming_Builder.cxx
|
||||
TNaming_Builder.hxx
|
||||
TNaming_CopyShape.cxx
|
||||
TNaming_CopyShape.hxx
|
||||
TNaming_DataMapIteratorOfDataMapOfShapePtrRefShape.hxx
|
||||
TNaming_DataMapOfShapeShapesSet.hxx
|
||||
TNaming_DataMapIteratorOfDataMapOfShapeShapesSet.hxx
|
||||
TNaming_ListOfMapOfShape.hxx
|
||||
TNaming_ListIteratorOfListOfMapOfShape.hxx
|
||||
TNaming_ListOfIndexedDataMapOfShapeListOfShape.hxx
|
||||
TNaming_DataMapOfShapePtrRefShape.hxx
|
||||
TNaming_DataMapOfShapeShapesSet.hxx
|
||||
TNaming_DeltaOnModification.cxx
|
||||
TNaming_DeltaOnModification.hxx
|
||||
TNaming_DeltaOnRemoval.cxx
|
||||
TNaming_DeltaOnRemoval.hxx
|
||||
TNaming_Evolution.hxx
|
||||
TNaming_Identifier.cxx
|
||||
TNaming_Identifier.hxx
|
||||
TNaming_Iterator.cxx
|
||||
TNaming_Iterator.hxx
|
||||
TNaming_Iterator.lxx
|
||||
TNaming_IteratorOnShapesSet.cxx
|
||||
TNaming_IteratorOnShapesSet.hxx
|
||||
TNaming_IteratorOnShapesSet.lxx
|
||||
TNaming_ListIteratorOfListOfIndexedDataMapOfShapeListOfShape.hxx
|
||||
TNaming_ListIteratorOfListOfMapOfShape.hxx
|
||||
TNaming_ListIteratorOfListOfNamedShape.hxx
|
||||
TNaming_ListOfIndexedDataMapOfShapeListOfShape.hxx
|
||||
TNaming_ListOfMapOfShape.hxx
|
||||
TNaming_ListOfNamedShape.hxx
|
||||
TNaming_Localizer.cxx
|
||||
TNaming_Localizer.hxx
|
||||
TNaming_MapIteratorOfMapOfNamedShape.hxx
|
||||
TNaming_MapOfNamedShape.hxx
|
||||
TNaming_Name.cxx
|
||||
TNaming_Name.hxx
|
||||
TNaming_Name.lxx
|
||||
TNaming_NamedShape.cxx
|
||||
TNaming_NamedShape.hxx
|
||||
TNaming_NamedShape.lxx
|
||||
TNaming_NamedShapeHasher.hxx
|
||||
TNaming_NameType.hxx
|
||||
TNaming_Naming.cxx
|
||||
TNaming_Naming.hxx
|
||||
TNaming_NamingTool.cxx
|
||||
TNaming_NamingTool.hxx
|
||||
TNaming_NCollections.hxx
|
||||
TNaming_NewShapeIterator.cxx
|
||||
TNaming_NewShapeIterator.hxx
|
||||
TNaming_NewShapeIterator.lxx
|
||||
TNaming_OldShapeIterator.cxx
|
||||
TNaming_OldShapeIterator.hxx
|
||||
TNaming_OldShapeIterator.lxx
|
||||
TNaming_PtrAttribute.hxx
|
||||
TNaming_PtrNode.hxx
|
||||
TNaming_PtrRefShape.hxx
|
||||
TNaming_RefShape.cxx
|
||||
TNaming_RefShape.hxx
|
||||
TNaming_RefShape.lxx
|
||||
TNaming_SameShapeIterator.cxx
|
||||
TNaming_SameShapeIterator.hxx
|
||||
TNaming_SameShapeIterator.lxx
|
||||
TNaming_Scope.cxx
|
||||
TNaming_Scope.hxx
|
||||
TNaming_Selector.cxx
|
||||
TNaming_Selector.hxx
|
||||
TNaming_ShapesSet.cxx
|
||||
TNaming_ShapesSet.hxx
|
||||
TNaming_ShapesSet.lxx
|
||||
TNaming_Tool.cxx
|
||||
TNaming_Tool.hxx
|
||||
TNaming_TranslateTool.cxx
|
||||
TNaming_TranslateTool.hxx
|
||||
TNaming_Translator.cxx
|
||||
TNaming_Translator.hxx
|
||||
TNaming_UsedShapes.cxx
|
||||
TNaming_UsedShapes.hxx
|
||||
TNaming_UsedShapes.lxx
|
||||
|
@@ -1,375 +0,0 @@
|
||||
-- Created on: 1997-03-17
|
||||
-- Created by: Yves FRICAUD
|
||||
-- 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.
|
||||
|
||||
package TNaming
|
||||
|
||||
---Purpose: A topological attribute can be seen as a hook
|
||||
-- into the topological structure. To this hook,
|
||||
-- data can be attached and references defined.
|
||||
-- It is used for keeping and access to
|
||||
-- topological objects and their evolution. All
|
||||
-- topological objects are stored in the one
|
||||
-- user-protected TNaming_UsedShapes
|
||||
-- attribute at the root label of the data
|
||||
-- framework. This attribute contains map with all
|
||||
-- topological shapes, used in this document.
|
||||
-- To all other labels TNaming_NamedShape
|
||||
-- attribute can be added. This attribute contains
|
||||
-- references (hooks) to shapes from the
|
||||
-- TNaming_UsedShapes attribute and evolution
|
||||
-- of these shapes. TNaming_NamedShape
|
||||
-- attribute contains a set of pairs of hooks: old
|
||||
-- shape and new shape (see the figure below).
|
||||
-- It allows not only get the topological shapes by
|
||||
-- the labels, but also trace evolution of the
|
||||
-- shapes and correctly resolve dependent
|
||||
-- shapes by the changed one.
|
||||
-- If shape is just-created, then the old shape for
|
||||
-- accorded named shape is an empty shape. If
|
||||
-- a shape is deleted, then the new shape in this named shape is empty.
|
||||
-- Different algorithms may dispose sub-shapes
|
||||
-- of the result shape at the individual label depending on necessity:
|
||||
-- - If a sub-shape must have some extra attributes (material of
|
||||
-- each face or color of each edge). In this case a specific sub-shape is
|
||||
-- placed to the separate label (usually, sub-label of the result shape label)
|
||||
-- with all attributes of this sub-shape.
|
||||
-- - If topological naming is needed, a necessary and sufficient
|
||||
-- (for selected sub-shapes identification) set of sub-shapes is
|
||||
-- placed to the child labels of the result
|
||||
-- shape label. As usual, as far as basic solids and closed shells are
|
||||
-- concerned, all faces of the shape are disposed. Edges and vertices
|
||||
-- sub-shapes can be identified as intersection of contiguous faces.
|
||||
-- Modified/generated shapes may be placed to one named shape and
|
||||
-- identified as this named shape and source named shape that also can be
|
||||
-- identified with used algorithms.
|
||||
-- TNaming_NamedShape may contain a few
|
||||
-- pairs of hooks with the same evolution. In this
|
||||
-- case topology shape, which belongs to the
|
||||
-- named shape, is a compound of new shapes.
|
||||
-- The data model contains both the topology
|
||||
-- and the hooks, and functions handle both
|
||||
-- topological entities and hooks. Consider the
|
||||
-- case of a box function, which creates a solid
|
||||
-- with six faces and six hooks. Each hook is
|
||||
-- attached to a face. If you want, you can also
|
||||
-- have this function create hooks for edges and
|
||||
-- vertices as well as for faces. For the sake of
|
||||
-- simplicity though, let's limit the example.
|
||||
-- Not all functions can define explicit hooks for
|
||||
-- all topological entities they create, but all
|
||||
-- topological entities can be turned into hooks
|
||||
-- when necessary. This is where topological naming is necessary.
|
||||
|
||||
|
||||
---Category: GUID
|
||||
-- c4ef4200-568f-11d1-8940-080009dc3333 TNaming_NamedShape
|
||||
-- c4ef4201-568f-11d1-8940-080009dc3333 TNaming_UsedShapes
|
||||
|
||||
|
||||
uses Standard,
|
||||
TCollection,
|
||||
TColStd,
|
||||
TopLoc,
|
||||
TopTools,
|
||||
TopoDS,
|
||||
TDF,
|
||||
TopAbs,
|
||||
gp
|
||||
|
||||
|
||||
is
|
||||
---Category: classes to copy shapes
|
||||
-- ======================
|
||||
|
||||
class CopyShape;
|
||||
|
||||
class TranslateTool;
|
||||
|
||||
private class Translator;
|
||||
|
||||
|
||||
---Category: classes to store shapes and their evolution in the framework
|
||||
-- ============================================================
|
||||
|
||||
enumeration Evolution is
|
||||
PRIMITIVE,
|
||||
GENERATED,
|
||||
MODIFY,
|
||||
DELETE,
|
||||
REPLACE,
|
||||
SELECTED
|
||||
end Evolution;
|
||||
---Purpose: Defines the type of evolution in old shape - new shape pairs.
|
||||
-- The definitions - in the form of the terms of
|
||||
-- the enumeration - are needed by the
|
||||
-- TNaming_NamedShape attribute and
|
||||
-- indicate what entities this attribute records as follows:
|
||||
-- - PRIMITIVE
|
||||
-- - New entities; in each pair, old shape is a
|
||||
-- null shape and new shape is a created
|
||||
-- entity.
|
||||
-- - GENERATED
|
||||
-- - Entities created from other entities; in
|
||||
-- each pair, old shape is the generator and
|
||||
-- new shape is the created entity.
|
||||
-- - MODIFY
|
||||
-- - Split or merged entities, in each pair, old
|
||||
-- shape is the entity before the operation
|
||||
-- and new shape is the new entity after the
|
||||
-- operation.
|
||||
-- - DELETE
|
||||
-- - Deletion of entities; in each pair, old
|
||||
-- shape is a deleted entity and new shape is null.
|
||||
-- - SELECTED
|
||||
-- - Named topological entities; in each pair,
|
||||
-- the new shape is a named entity and the
|
||||
-- old shape is not used.
|
||||
--
|
||||
-- For a split which generates multiple faces, the
|
||||
-- attribute will contain many pairs with the same
|
||||
-- old shape; for a merge, it will contain many
|
||||
-- pairs with the same new shape.
|
||||
-- Finally, an example of delete would be a face
|
||||
-- removed by a Boolean operation.
|
||||
|
||||
class NamedShape;
|
||||
|
||||
|
||||
private class UsedShapes;
|
||||
|
||||
|
||||
|
||||
|
||||
class Builder;
|
||||
|
||||
class Tool;
|
||||
|
||||
class Iterator;
|
||||
|
||||
class NewShapeIterator;
|
||||
|
||||
class OldShapeIterator;
|
||||
|
||||
class SameShapeIterator;
|
||||
|
||||
|
||||
|
||||
imported NamedShapeHasher;
|
||||
|
||||
imported MapOfNamedShape;
|
||||
|
||||
imported MapIteratorOfMapOfNamedShape;
|
||||
|
||||
imported ListOfNamedShape;
|
||||
|
||||
imported ListIteratorOfListOfNamedShape;
|
||||
|
||||
|
||||
---Category: classes to store selected shape (involve naming algorithm)
|
||||
-- ==========================================================
|
||||
|
||||
|
||||
enumeration NameType is
|
||||
---Purpose: to store naming characteristcs
|
||||
UNKNOWN,
|
||||
IDENTITY,
|
||||
MODIFUNTIL,
|
||||
GENERATION,
|
||||
INTERSECTION,
|
||||
UNION,
|
||||
SUBSTRACTION,
|
||||
CONSTSHAPE,
|
||||
FILTERBYNEIGHBOURGS,
|
||||
ORIENTATION,
|
||||
WIREIN,
|
||||
SHELLIN
|
||||
end NameType;
|
||||
|
||||
class Name;
|
||||
|
||||
class Naming;
|
||||
|
||||
class Selector;
|
||||
|
||||
|
||||
|
||||
---Category: Private classes for TNaming
|
||||
-- ===========================
|
||||
|
||||
private class DeltaOnRemoval;
|
||||
|
||||
private class DeltaOnModification;
|
||||
|
||||
|
||||
pointer PtrAttribute to NamedShape from TNaming;
|
||||
|
||||
imported Node;
|
||||
|
||||
pointer PtrNode to Node from TNaming;
|
||||
|
||||
private class RefShape;
|
||||
|
||||
pointer PtrRefShape to RefShape from TNaming;
|
||||
|
||||
imported DataMapOfShapePtrRefShape;
|
||||
|
||||
imported DataMapIteratorOfDataMapOfShapePtrRefShape;
|
||||
|
||||
---Category: private classes for ANaming
|
||||
-- ===========================
|
||||
|
||||
|
||||
private class Scope;
|
||||
|
||||
private class Identifier;
|
||||
|
||||
private class Localizer;
|
||||
|
||||
private class ShapesSet;
|
||||
|
||||
private class IteratorOnShapesSet;
|
||||
|
||||
imported DataMapOfShapeShapesSet;
|
||||
|
||||
imported DataMapIteratorOfDataMapOfShapeShapesSet;
|
||||
|
||||
imported ListOfMapOfShape;
|
||||
|
||||
imported ListIteratorOfListOfMapOfShape;
|
||||
imported ListOfIndexedDataMapOfShapeListOfShape;
|
||||
imported ListIteratorOfListOfIndexedDataMapOfShapeListOfShape;
|
||||
|
||||
|
||||
private class NamingTool;
|
||||
|
||||
|
||||
---Category: package methods for NamedShape
|
||||
-- ==============================
|
||||
|
||||
Substitute (labelsource : Label from TDF;
|
||||
labelcible : Label from TDF;
|
||||
mapOldNew : in out DataMapOfShapeShape from TopTools);
|
||||
---Purpose: Subtituter les shapes sur les structures de source
|
||||
-- vers cible
|
||||
|
||||
|
||||
Update (label : Label from TDF;
|
||||
mapOldNew : in out DataMapOfShapeShape from TopTools);
|
||||
---Purpose: Mise a jour des shapes du label et de ses fils en
|
||||
-- tenant compte des substitutions decrite par
|
||||
-- mapOldNew.
|
||||
--
|
||||
-- Warning: le remplacement du shape est fait dans tous
|
||||
-- les attributs qui le contiennent meme si ceux
|
||||
-- ci ne sont pas associees a des sous-labels de <Label>.
|
||||
|
||||
Displace (label : Label from TDF;
|
||||
aLocation : Location from TopLoc;
|
||||
WithOld : Boolean from Standard = Standard_True);
|
||||
---Purpose: Application de la Location sur les shapes du label
|
||||
-- et de ses sous labels.
|
||||
|
||||
ChangeShapes (label : Label from TDF;
|
||||
M : in out DataMapOfShapeShape from TopTools);
|
||||
---Purpose: Remplace les shapes du label et des sous-labels
|
||||
-- par des copies.
|
||||
|
||||
Transform (label : Label from TDF;
|
||||
aTransformation : Trsf from gp);
|
||||
---Purpose: Application de la transformation sur les shapes du
|
||||
-- label et de ses sous labels.
|
||||
-- Warning: le remplacement du shape est fait dans tous
|
||||
-- les attributs qui le contiennent meme si ceux
|
||||
-- ci ne sont pas associees a des sous-labels de <Label>.
|
||||
|
||||
|
||||
Replicate (NS : NamedShape from TNaming;
|
||||
T : Trsf from gp;
|
||||
L : Label from TDF);
|
||||
---Purpose: Replicates the named shape with the transformation <T>
|
||||
-- on the label <L> (and sub-labels if necessary)
|
||||
-- (TNaming_GENERATED is set)
|
||||
|
||||
Replicate (SH : Shape from TopoDS;
|
||||
T : Trsf from gp;
|
||||
L : Label from TDF);
|
||||
---Purpose: Replicates the shape with the transformation <T>
|
||||
-- on the label <L> (and sub-labels if necessary)
|
||||
-- (TNaming_GENERATED is set)
|
||||
|
||||
|
||||
MakeShape(MS : MapOfShape from TopTools)
|
||||
returns Shape from TopoDS;
|
||||
---Purpose: Builds shape from map content
|
||||
|
||||
FindUniqueContext(S : Shape from TopoDS; Context : Shape from TopoDS)
|
||||
returns Shape from TopoDS;
|
||||
---Purpose: Find unique context of shape <S>
|
||||
|
||||
FindUniqueContextSet(S : Shape from TopoDS; Context : Shape from TopoDS;
|
||||
Arr : in out HArray1OfShape from TopTools)
|
||||
returns Shape from TopoDS;
|
||||
---Purpose: Find unique context of shape <S>,which is pure concatenation
|
||||
-- of atomic shapes (Compound). The result is concatenation of
|
||||
-- single contexts
|
||||
|
||||
SubstituteSShape(accesslabel : Label from TDF;
|
||||
From : Shape from TopoDS;
|
||||
To : in out Shape from TopoDS)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Subtitutes shape in source structure
|
||||
|
||||
|
||||
OuterWire(theFace: Face from TopoDS; theWire: out Wire from TopoDS)
|
||||
returns Boolean from Standard;
|
||||
--- Purpose: Returns True if outer wire is found and the found wire in <theWire>.
|
||||
|
||||
OuterShell(theSolid: Solid from TopoDS; theShell: out Shell from TopoDS)
|
||||
returns Boolean from Standard;
|
||||
--- Purpose: Returns True if outer Shell is found and the found shell in <theShell>.
|
||||
|
||||
|
||||
|
||||
---Purpose: Print of TNaming enumeration
|
||||
-- =============================
|
||||
|
||||
IDList(anIDList : in out IDList from TDF);
|
||||
---Purpose: Appends to <anIDList> the list of the attributes
|
||||
-- IDs of this package. CAUTION: <anIDList> is NOT
|
||||
-- cleared before use.
|
||||
|
||||
|
||||
Print (EVOL : Evolution from TNaming; S : in out OStream)
|
||||
---Purpose: Prints the evolution <EVOL> as a String on the
|
||||
-- Stream <S> and returns <S>.
|
||||
---C++: return &
|
||||
returns OStream;
|
||||
|
||||
Print (NAME : NameType from TNaming; S : in out OStream)
|
||||
---Purpose: Prints the name of name type <NAME> as a String on
|
||||
-- the Stream <S> and returns <S>.
|
||||
---C++: return &
|
||||
returns OStream;
|
||||
|
||||
Print (ACCESS : Label from TDF; S : in out OStream)
|
||||
---Purpose: Prints the content of UsedShapes private attribute as a String Table on
|
||||
-- the Stream <S> and returns <S>.
|
||||
---C++: return &
|
||||
returns OStream;
|
||||
|
||||
|
||||
end TNaming;
|
||||
|
@@ -14,51 +14,54 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming.ixx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepBuilderAPI_Transform.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <BRepClass3d_SolidClassifier.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <IntTools_FClass2d.hxx>
|
||||
#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TNaming.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_DataMapOfShapePtrRefShape.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_ListIteratorOfListOfNamedShape.hxx>
|
||||
#include <TNaming_ListOfNamedShape.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_NewShapeIterator.hxx>
|
||||
#include <TNaming_RefShape.hxx>
|
||||
#include <TNaming_ShapesSet.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_TranslateTool.hxx>
|
||||
#include <TNaming_UsedShapes.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopLoc_Datum3D.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopTools_DataMapIteratorOfDataMapOfOrientedShapeShape.hxx>
|
||||
#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
|
||||
#include <TopTools_DataMapOfOrientedShapeShape.hxx>
|
||||
#include <TopTools_DataMapIteratorOfDataMapOfOrientedShapeShape.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_UsedShapes.hxx>
|
||||
#include <TNaming_ShapesSet.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_NewShapeIterator.hxx>
|
||||
#include <TNaming_ListOfNamedShape.hxx>
|
||||
#include <TNaming_ListIteratorOfListOfNamedShape.hxx>
|
||||
#include <TNaming_RefShape.hxx>
|
||||
#include <TNaming_DataMapOfShapePtrRefShape.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
|
||||
#include <IntTools_FClass2d.hxx>
|
||||
#include <BRepClass3d_SolidClassifier.hxx>
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
|
||||
// CopyShape
|
||||
#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
|
||||
#include <TNaming_TranslateTool.hxx>
|
||||
#include <TopLoc_Datum3D.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : MapShapes
|
||||
//purpose : TNaming
|
||||
//=======================================================================
|
||||
|
||||
static void MapShapes(const TopoDS_Shape& SCible, const TopoDS_Shape& SSource, TopTools_DataMapOfShapeShape& M)
|
||||
{
|
||||
M.Bind(SCible,SSource);
|
||||
|
252
src/TNaming/TNaming.hxx
Normal file
252
src/TNaming/TNaming.hxx
Normal file
@@ -0,0 +1,252 @@
|
||||
// Created on: 1997-03-17
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_HeaderFile
|
||||
#define _TNaming_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_HArray1OfShape.hxx>
|
||||
#include <TDF_IDList.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <TNaming_Evolution.hxx>
|
||||
#include <TNaming_NameType.hxx>
|
||||
class TDF_Label;
|
||||
class TopLoc_Location;
|
||||
class gp_Trsf;
|
||||
class TNaming_NamedShape;
|
||||
class TopoDS_Shape;
|
||||
class TopoDS_Face;
|
||||
class TopoDS_Wire;
|
||||
class TopoDS_Solid;
|
||||
class TopoDS_Shell;
|
||||
class TNaming_CopyShape;
|
||||
class TNaming_TranslateTool;
|
||||
class TNaming_Translator;
|
||||
class TNaming_NamedShape;
|
||||
class TNaming_UsedShapes;
|
||||
class TNaming_Builder;
|
||||
class TNaming_Tool;
|
||||
class TNaming_Iterator;
|
||||
class TNaming_NewShapeIterator;
|
||||
class TNaming_OldShapeIterator;
|
||||
class TNaming_SameShapeIterator;
|
||||
class TNaming_Name;
|
||||
class TNaming_Naming;
|
||||
class TNaming_Selector;
|
||||
class TNaming_DeltaOnRemoval;
|
||||
class TNaming_DeltaOnModification;
|
||||
class TNaming_RefShape;
|
||||
class TNaming_Scope;
|
||||
class TNaming_Identifier;
|
||||
class TNaming_Localizer;
|
||||
class TNaming_ShapesSet;
|
||||
class TNaming_IteratorOnShapesSet;
|
||||
class TNaming_NamingTool;
|
||||
|
||||
|
||||
//! A topological attribute can be seen as a hook
|
||||
//! into the topological structure. To this hook,
|
||||
//! data can be attached and references defined.
|
||||
//! It is used for keeping and access to
|
||||
//! topological objects and their evolution. All
|
||||
//! topological objects are stored in the one
|
||||
//! user-protected TNaming_UsedShapes
|
||||
//! attribute at the root label of the data
|
||||
//! framework. This attribute contains map with all
|
||||
//! topological shapes, used in this document.
|
||||
//! To all other labels TNaming_NamedShape
|
||||
//! attribute can be added. This attribute contains
|
||||
//! references (hooks) to shapes from the
|
||||
//! TNaming_UsedShapes attribute and evolution
|
||||
//! of these shapes. TNaming_NamedShape
|
||||
//! attribute contains a set of pairs of hooks: old
|
||||
//! shape and new shape (see the figure below).
|
||||
//! It allows not only get the topological shapes by
|
||||
//! the labels, but also trace evolution of the
|
||||
//! shapes and correctly resolve dependent
|
||||
//! shapes by the changed one.
|
||||
//! If shape is just-created, then the old shape for
|
||||
//! accorded named shape is an empty shape. If
|
||||
//! a shape is deleted, then the new shape in this named shape is empty.
|
||||
//! Different algorithms may dispose sub-shapes
|
||||
//! of the result shape at the individual label depending on necessity:
|
||||
//! - If a sub-shape must have some extra attributes (material of
|
||||
//! each face or color of each edge). In this case a specific sub-shape is
|
||||
//! placed to the separate label (usually, sub-label of the result shape label)
|
||||
//! with all attributes of this sub-shape.
|
||||
//! - If topological naming is needed, a necessary and sufficient
|
||||
//! (for selected sub-shapes identification) set of sub-shapes is
|
||||
//! placed to the child labels of the result
|
||||
//! shape label. As usual, as far as basic solids and closed shells are
|
||||
//! concerned, all faces of the shape are disposed. Edges and vertices
|
||||
//! sub-shapes can be identified as intersection of contiguous faces.
|
||||
//! Modified/generated shapes may be placed to one named shape and
|
||||
//! identified as this named shape and source named shape that also can be
|
||||
//! identified with used algorithms.
|
||||
//! TNaming_NamedShape may contain a few
|
||||
//! pairs of hooks with the same evolution. In this
|
||||
//! case topology shape, which belongs to the
|
||||
//! named shape, is a compound of new shapes.
|
||||
//! The data model contains both the topology
|
||||
//! and the hooks, and functions handle both
|
||||
//! topological entities and hooks. Consider the
|
||||
//! case of a box function, which creates a solid
|
||||
//! with six faces and six hooks. Each hook is
|
||||
//! attached to a face. If you want, you can also
|
||||
//! have this function create hooks for edges and
|
||||
//! vertices as well as for faces. For the sake of
|
||||
//! simplicity though, let's limit the example.
|
||||
//! Not all functions can define explicit hooks for
|
||||
//! all topological entities they create, but all
|
||||
//! topological entities can be turned into hooks
|
||||
//! when necessary. This is where topological naming is necessary.
|
||||
class TNaming
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Subtituter les shapes sur les structures de source
|
||||
//! vers cible
|
||||
Standard_EXPORT static void Substitute (const TDF_Label& labelsource, const TDF_Label& labelcible, TopTools_DataMapOfShapeShape& mapOldNew);
|
||||
|
||||
//! Mise a jour des shapes du label et de ses fils en
|
||||
//! tenant compte des substitutions decrite par
|
||||
//! mapOldNew.
|
||||
//!
|
||||
//! Warning: le remplacement du shape est fait dans tous
|
||||
//! les attributs qui le contiennent meme si ceux
|
||||
//! ci ne sont pas associees a des sous-labels de <Label>.
|
||||
Standard_EXPORT static void Update (const TDF_Label& label, TopTools_DataMapOfShapeShape& mapOldNew);
|
||||
|
||||
//! Application de la Location sur les shapes du label
|
||||
//! et de ses sous labels.
|
||||
Standard_EXPORT static void Displace (const TDF_Label& label, const TopLoc_Location& aLocation, const Standard_Boolean WithOld = Standard_True);
|
||||
|
||||
//! Remplace les shapes du label et des sous-labels
|
||||
//! par des copies.
|
||||
Standard_EXPORT static void ChangeShapes (const TDF_Label& label, TopTools_DataMapOfShapeShape& M);
|
||||
|
||||
//! Application de la transformation sur les shapes du
|
||||
//! label et de ses sous labels.
|
||||
//! Warning: le remplacement du shape est fait dans tous
|
||||
//! les attributs qui le contiennent meme si ceux
|
||||
//! ci ne sont pas associees a des sous-labels de <Label>.
|
||||
Standard_EXPORT static void Transform (const TDF_Label& label, const gp_Trsf& aTransformation);
|
||||
|
||||
//! Replicates the named shape with the transformation <T>
|
||||
//! on the label <L> (and sub-labels if necessary)
|
||||
//! (TNaming_GENERATED is set)
|
||||
Standard_EXPORT static void Replicate (const Handle(TNaming_NamedShape)& NS, const gp_Trsf& T, const TDF_Label& L);
|
||||
|
||||
//! Replicates the shape with the transformation <T>
|
||||
//! on the label <L> (and sub-labels if necessary)
|
||||
//! (TNaming_GENERATED is set)
|
||||
Standard_EXPORT static void Replicate (const TopoDS_Shape& SH, const gp_Trsf& T, const TDF_Label& L);
|
||||
|
||||
//! Builds shape from map content
|
||||
Standard_EXPORT static TopoDS_Shape MakeShape (const TopTools_MapOfShape& MS);
|
||||
|
||||
//! Find unique context of shape <S>
|
||||
Standard_EXPORT static TopoDS_Shape FindUniqueContext (const TopoDS_Shape& S, const TopoDS_Shape& Context);
|
||||
|
||||
//! Find unique context of shape <S>,which is pure concatenation
|
||||
//! of atomic shapes (Compound). The result is concatenation of
|
||||
//! single contexts
|
||||
Standard_EXPORT static TopoDS_Shape FindUniqueContextSet (const TopoDS_Shape& S, const TopoDS_Shape& Context, Handle(TopTools_HArray1OfShape)& Arr);
|
||||
|
||||
//! Subtitutes shape in source structure
|
||||
Standard_EXPORT static Standard_Boolean SubstituteSShape (const TDF_Label& accesslabel, const TopoDS_Shape& From, TopoDS_Shape& To);
|
||||
|
||||
//! Returns True if outer wire is found and the found wire in <theWire>.
|
||||
Standard_EXPORT static Standard_Boolean OuterWire (const TopoDS_Face& theFace, TopoDS_Wire& theWire);
|
||||
|
||||
//! Returns True if outer Shell is found and the found shell in <theShell>.
|
||||
//! Print of TNaming enumeration
|
||||
//! =============================
|
||||
Standard_EXPORT static Standard_Boolean OuterShell (const TopoDS_Solid& theSolid, TopoDS_Shell& theShell);
|
||||
|
||||
//! Appends to <anIDList> the list of the attributes
|
||||
//! IDs of this package. CAUTION: <anIDList> is NOT
|
||||
//! cleared before use.
|
||||
Standard_EXPORT static void IDList (TDF_IDList& anIDList);
|
||||
|
||||
//! Prints the evolution <EVOL> as a String on the
|
||||
//! Stream <S> and returns <S>.
|
||||
Standard_EXPORT static Standard_OStream& Print (const TNaming_Evolution EVOL, Standard_OStream& S);
|
||||
|
||||
//! Prints the name of name type <NAME> as a String on
|
||||
//! the Stream <S> and returns <S>.
|
||||
Standard_EXPORT static Standard_OStream& Print (const TNaming_NameType NAME, Standard_OStream& S);
|
||||
|
||||
//! Prints the content of UsedShapes private attribute as a String Table on
|
||||
//! the Stream <S> and returns <S>.
|
||||
Standard_EXPORT static Standard_OStream& Print (const TDF_Label& ACCESS, Standard_OStream& S);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
friend class TNaming_CopyShape;
|
||||
friend class TNaming_TranslateTool;
|
||||
friend class TNaming_Translator;
|
||||
friend class TNaming_NamedShape;
|
||||
friend class TNaming_UsedShapes;
|
||||
friend class TNaming_Builder;
|
||||
friend class TNaming_Tool;
|
||||
friend class TNaming_Iterator;
|
||||
friend class TNaming_NewShapeIterator;
|
||||
friend class TNaming_OldShapeIterator;
|
||||
friend class TNaming_SameShapeIterator;
|
||||
friend class TNaming_Name;
|
||||
friend class TNaming_Naming;
|
||||
friend class TNaming_Selector;
|
||||
friend class TNaming_DeltaOnRemoval;
|
||||
friend class TNaming_DeltaOnModification;
|
||||
friend class TNaming_RefShape;
|
||||
friend class TNaming_Scope;
|
||||
friend class TNaming_Identifier;
|
||||
friend class TNaming_Localizer;
|
||||
friend class TNaming_ShapesSet;
|
||||
friend class TNaming_IteratorOnShapesSet;
|
||||
friend class TNaming_NamingTool;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_HeaderFile
|
@@ -1,88 +0,0 @@
|
||||
-- Created on: 1996-12-16
|
||||
-- Created by: Remi Lequette
|
||||
-- Copyright (c) 1996-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.
|
||||
|
||||
class Builder from TNaming
|
||||
|
||||
---Purpose: A tool to create and maintain topological attributes.
|
||||
-- Constructor creates an empty
|
||||
-- TNaming_NamedShape attribute at the given
|
||||
-- label. It allows adding "old shape" and "new
|
||||
-- shape" pairs with the specified evolution to this
|
||||
-- named shape. One evolution type per one
|
||||
-- builder must be used.
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
Label from TDF,
|
||||
Data from TDF,
|
||||
NamedShape from TNaming,
|
||||
UsedShapes from TNaming
|
||||
|
||||
raises
|
||||
ConstructionError from Standard
|
||||
is
|
||||
|
||||
Create (aLabel : Label from TDF) returns Builder from TNaming;
|
||||
---Purpose: Create an Builder.
|
||||
-- Warning: Before Addition copies the current Value, and clear
|
||||
|
||||
|
||||
---Category: To Load Shape Evolution
|
||||
-- =======================
|
||||
|
||||
Generated(me : in out; newShape : Shape from TopoDS);
|
||||
---Purpose: Records the shape newShape which was
|
||||
-- generated during a topological construction.
|
||||
-- As an example, consider the case of a face
|
||||
-- generated in construction of a box.
|
||||
|
||||
Generated(me : in out; oldShape, newShape : Shape from TopoDS);
|
||||
---Purpose: Records the shape newShape which was
|
||||
-- generated from the shape oldShape during a topological construction.
|
||||
-- As an example, consider the case of a face
|
||||
-- generated from an edge in construction of a prism.
|
||||
|
||||
|
||||
---Category: Load Modifications.
|
||||
|
||||
Delete(me : in out; oldShape : Shape from TopoDS);
|
||||
---Purpose: Records the shape oldShape which was deleted from the current label.
|
||||
-- As an example, consider the case of a face removed by a Boolean operation.
|
||||
|
||||
Modify(me : in out; oldShape, newShape : Shape from TopoDS);
|
||||
---Purpose: Records the shape newShape which is a
|
||||
-- modification of the shape oldShape.
|
||||
-- As an example, consider the case of a face split
|
||||
-- or merged in a Boolean operation.
|
||||
--
|
||||
|
||||
---Category: Load Selection.
|
||||
Select (me : in out; aShape, inShape : Shape from TopoDS);
|
||||
---Purpose: Add a Shape to the current label , This Shape is
|
||||
-- unmodified. Used for example to define a set
|
||||
-- of shapes under a label.
|
||||
|
||||
|
||||
---Category: Querying
|
||||
|
||||
NamedShape(me) returns NamedShape from TNaming;
|
||||
---Purpose: Returns the NamedShape which has been built or is under construction.
|
||||
|
||||
fields
|
||||
|
||||
myShapes: UsedShapes from TNaming;
|
||||
myAtt : NamedShape from TNaming;
|
||||
end Builder;
|
@@ -14,6 +14,12 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_Builder.ixx>
|
||||
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_UsedShapes.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
// See methods'body in TNaming_NamedShape.cxx
|
||||
|
104
src/TNaming/TNaming_Builder.hxx
Normal file
104
src/TNaming/TNaming_Builder.hxx
Normal file
@@ -0,0 +1,104 @@
|
||||
// Created on: 1996-12-16
|
||||
// Created by: Remi Lequette
|
||||
// Copyright (c) 1996-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 _TNaming_Builder_HeaderFile
|
||||
#define _TNaming_Builder_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
class TNaming_UsedShapes;
|
||||
class TNaming_NamedShape;
|
||||
class Standard_ConstructionError;
|
||||
class TDF_Label;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
//! A tool to create and maintain topological attributes.
|
||||
//! Constructor creates an empty
|
||||
//! TNaming_NamedShape attribute at the given
|
||||
//! label. It allows adding "old shape" and "new
|
||||
//! shape" pairs with the specified evolution to this
|
||||
//! named shape. One evolution type per one
|
||||
//! builder must be used.
|
||||
class TNaming_Builder
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Create an Builder.
|
||||
//! Warning: Before Addition copies the current Value, and clear
|
||||
Standard_EXPORT TNaming_Builder(const TDF_Label& aLabel);
|
||||
|
||||
//! Records the shape newShape which was
|
||||
//! generated during a topological construction.
|
||||
//! As an example, consider the case of a face
|
||||
//! generated in construction of a box.
|
||||
Standard_EXPORT void Generated (const TopoDS_Shape& newShape);
|
||||
|
||||
//! Records the shape newShape which was
|
||||
//! generated from the shape oldShape during a topological construction.
|
||||
//! As an example, consider the case of a face
|
||||
//! generated from an edge in construction of a prism.
|
||||
Standard_EXPORT void Generated (const TopoDS_Shape& oldShape, const TopoDS_Shape& newShape);
|
||||
|
||||
//! Records the shape oldShape which was deleted from the current label.
|
||||
//! As an example, consider the case of a face removed by a Boolean operation.
|
||||
Standard_EXPORT void Delete (const TopoDS_Shape& oldShape);
|
||||
|
||||
//! Records the shape newShape which is a
|
||||
//! modification of the shape oldShape.
|
||||
//! As an example, consider the case of a face split
|
||||
//! or merged in a Boolean operation.
|
||||
Standard_EXPORT void Modify (const TopoDS_Shape& oldShape, const TopoDS_Shape& newShape);
|
||||
|
||||
//! Add a Shape to the current label , This Shape is
|
||||
//! unmodified. Used for example to define a set
|
||||
//! of shapes under a label.
|
||||
Standard_EXPORT void Select (const TopoDS_Shape& aShape, const TopoDS_Shape& inShape);
|
||||
|
||||
//! Returns the NamedShape which has been built or is under construction.
|
||||
Standard_EXPORT Handle(TNaming_NamedShape) NamedShape() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(TNaming_UsedShapes) myShapes;
|
||||
Handle(TNaming_NamedShape) myAtt;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_Builder_HeaderFile
|
@@ -1,49 +0,0 @@
|
||||
-- Created on: 2000-02-14
|
||||
-- Created by: Denis PASCAL
|
||||
-- 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.
|
||||
|
||||
class CopyShape from TNaming
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses Shape from TopoDS,
|
||||
IndexedDataMapOfTransientTransient from TColStd,
|
||||
TranslateTool from TNaming,
|
||||
Location from TopLoc
|
||||
|
||||
is
|
||||
|
||||
CopyTool (myclass;
|
||||
aShape : Shape from TopoDS;
|
||||
aMap : in out IndexedDataMapOfTransientTransient from TColStd;
|
||||
aResult : in out Shape from TopoDS);
|
||||
---Purpose: Makes copy a set of shape(s), using the aMap
|
||||
|
||||
|
||||
Translate (myclass;
|
||||
aShape : Shape from TopoDS;
|
||||
aMap : in out IndexedDataMapOfTransientTransient from TColStd;
|
||||
aResult : in out Shape from TopoDS;
|
||||
TrTool : TranslateTool from TNaming);
|
||||
|
||||
---Purpose: Translates a Transient shape(s) to Transient
|
||||
|
||||
Translate (myclass;
|
||||
L : Location from TopLoc;
|
||||
aMap : in out IndexedDataMapOfTransientTransient from TColStd)
|
||||
returns Location from TopLoc;
|
||||
---Purpose: Translates a Topological Location to an other Top.
|
||||
-- Location
|
||||
|
||||
end CopyShape;
|
@@ -13,19 +13,22 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_CopyShape.ixx>
|
||||
|
||||
#include <TNaming_CopyShape.hxx>
|
||||
#include <TNaming_TranslateTool.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopLoc_Datum3D.hxx>
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopLoc_Datum3D.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : CopyTool
|
||||
//purpose : Tool to copy a set of shape(s), using the aMap
|
||||
//=======================================================================
|
||||
|
||||
void TNaming_CopyShape::CopyTool( const TopoDS_Shape& aShape,
|
||||
TColStd_IndexedDataMapOfTransientTransient& aMap,
|
||||
TopoDS_Shape& aResult)
|
||||
|
70
src/TNaming/TNaming_CopyShape.hxx
Normal file
70
src/TNaming/TNaming_CopyShape.hxx
Normal file
@@ -0,0 +1,70 @@
|
||||
// Created on: 2000-02-14
|
||||
// Created by: Denis PASCAL
|
||||
// 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 _TNaming_CopyShape_HeaderFile
|
||||
#define _TNaming_CopyShape_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
|
||||
class TopoDS_Shape;
|
||||
class TNaming_TranslateTool;
|
||||
class TopLoc_Location;
|
||||
|
||||
|
||||
|
||||
class TNaming_CopyShape
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Makes copy a set of shape(s), using the aMap
|
||||
Standard_EXPORT static void CopyTool (const TopoDS_Shape& aShape, TColStd_IndexedDataMapOfTransientTransient& aMap, TopoDS_Shape& aResult);
|
||||
|
||||
//! Translates a Transient shape(s) to Transient
|
||||
Standard_EXPORT static void Translate (const TopoDS_Shape& aShape, TColStd_IndexedDataMapOfTransientTransient& aMap, TopoDS_Shape& aResult, const Handle(TNaming_TranslateTool)& TrTool);
|
||||
|
||||
//! Translates a Topological Location to an other Top.
|
||||
//! Location
|
||||
Standard_EXPORT static TopLoc_Location Translate (const TopLoc_Location& L, TColStd_IndexedDataMapOfTransientTransient& aMap);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_CopyShape_HeaderFile
|
@@ -1,46 +0,0 @@
|
||||
-- Created on: 1997-12-03
|
||||
-- Created by: Yves FRICAUD
|
||||
-- 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.
|
||||
|
||||
private class DeltaOnModification from TNaming inherits DeltaOnModification from TDF
|
||||
|
||||
---Purpose: This class provides default services for an
|
||||
-- AttributeDelta on a MODIFICATION action.
|
||||
--
|
||||
-- Applying this AttributeDelta means GOING BACK to
|
||||
-- the attribute previously registered state.
|
||||
|
||||
uses
|
||||
|
||||
Attribute from TDF,
|
||||
HArray1OfShape from TopTools,
|
||||
NamedShape from TNaming
|
||||
|
||||
is
|
||||
|
||||
Create (NS : NamedShape from TNaming)
|
||||
returns DeltaOnModification from TNaming;
|
||||
---Purpose: Initializes a TDF_DeltaOnModification.
|
||||
|
||||
Apply (me : mutable)
|
||||
is redefined virtual;
|
||||
---Purpose: Applies the delta to the attribute.
|
||||
|
||||
fields
|
||||
|
||||
myOld : HArray1OfShape from TopTools;
|
||||
myNew : HArray1OfShape from TopTools;
|
||||
|
||||
end DeltaOnModification;
|
@@ -14,18 +14,20 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_DeltaOnModification.ixx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_Evolution.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDF_DeltaOnModification.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_DeltaOnModification.hxx>
|
||||
#include <TNaming_Evolution.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : TNaming_DeltaOnModification
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TNaming_DeltaOnModification::TNaming_DeltaOnModification(const Handle(TNaming_NamedShape)& NS)
|
||||
: TDF_DeltaOnModification(NS)
|
||||
{
|
||||
|
73
src/TNaming/TNaming_DeltaOnModification.hxx
Normal file
73
src/TNaming/TNaming_DeltaOnModification.hxx
Normal file
@@ -0,0 +1,73 @@
|
||||
// Created on: 1997-12-03
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_DeltaOnModification_HeaderFile
|
||||
#define _TNaming_DeltaOnModification_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TopTools_HArray1OfShape.hxx>
|
||||
#include <TDF_DeltaOnModification.hxx>
|
||||
class TNaming_NamedShape;
|
||||
|
||||
|
||||
class TNaming_DeltaOnModification;
|
||||
DEFINE_STANDARD_HANDLE(TNaming_DeltaOnModification, TDF_DeltaOnModification)
|
||||
|
||||
//! This class provides default services for an
|
||||
//! AttributeDelta on a MODIFICATION action.
|
||||
//!
|
||||
//! Applying this AttributeDelta means GOING BACK to
|
||||
//! the attribute previously registered state.
|
||||
class TNaming_DeltaOnModification : public TDF_DeltaOnModification
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Initializes a TDF_DeltaOnModification.
|
||||
Standard_EXPORT TNaming_DeltaOnModification(const Handle(TNaming_NamedShape)& NS);
|
||||
|
||||
//! Applies the delta to the attribute.
|
||||
Standard_EXPORT virtual void Apply() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TNaming_DeltaOnModification,TDF_DeltaOnModification)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(TopTools_HArray1OfShape) myOld;
|
||||
Handle(TopTools_HArray1OfShape) myNew;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_DeltaOnModification_HeaderFile
|
@@ -1,39 +0,0 @@
|
||||
-- Created on: 1997-12-03
|
||||
-- Created by: Yves FRICAUD
|
||||
-- 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.
|
||||
|
||||
private class DeltaOnRemoval from TNaming inherits DeltaOnRemoval from TDF
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
DeltaOnModification from TNaming,
|
||||
NamedShape from TNaming
|
||||
is
|
||||
|
||||
Create (NS : NamedShape from TNaming)
|
||||
returns DeltaOnRemoval from TNaming;
|
||||
---Purpose: Initializes a TDF_DeltaOnModification.
|
||||
|
||||
Apply (me : mutable)
|
||||
is redefined virtual;
|
||||
---Purpose: Applies the delta to the attribute.
|
||||
|
||||
fields
|
||||
|
||||
myDelta : DeltaOnModification from TNaming;
|
||||
|
||||
end DeltaOnRemoval;
|
||||
|
@@ -14,15 +14,17 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_DeltaOnRemoval.ixx>
|
||||
#include <TNaming_DeltaOnModification.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDF_DeltaOnRemoval.hxx>
|
||||
#include <TNaming_DeltaOnModification.hxx>
|
||||
#include <TNaming_DeltaOnRemoval.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : TNaming_DeltaOnModification
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TNaming_DeltaOnRemoval::TNaming_DeltaOnRemoval(const Handle(TNaming_NamedShape)& NS)
|
||||
:TDF_DeltaOnRemoval(NS)
|
||||
{
|
||||
|
68
src/TNaming/TNaming_DeltaOnRemoval.hxx
Normal file
68
src/TNaming/TNaming_DeltaOnRemoval.hxx
Normal file
@@ -0,0 +1,68 @@
|
||||
// Created on: 1997-12-03
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_DeltaOnRemoval_HeaderFile
|
||||
#define _TNaming_DeltaOnRemoval_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TDF_DeltaOnRemoval.hxx>
|
||||
class TNaming_DeltaOnModification;
|
||||
class TNaming_NamedShape;
|
||||
|
||||
|
||||
class TNaming_DeltaOnRemoval;
|
||||
DEFINE_STANDARD_HANDLE(TNaming_DeltaOnRemoval, TDF_DeltaOnRemoval)
|
||||
|
||||
|
||||
class TNaming_DeltaOnRemoval : public TDF_DeltaOnRemoval
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Initializes a TDF_DeltaOnModification.
|
||||
Standard_EXPORT TNaming_DeltaOnRemoval(const Handle(TNaming_NamedShape)& NS);
|
||||
|
||||
//! Applies the delta to the attribute.
|
||||
Standard_EXPORT virtual void Apply() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TNaming_DeltaOnRemoval,TDF_DeltaOnRemoval)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(TNaming_DeltaOnModification) myDelta;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_DeltaOnRemoval_HeaderFile
|
62
src/TNaming/TNaming_Evolution.hxx
Normal file
62
src/TNaming/TNaming_Evolution.hxx
Normal file
@@ -0,0 +1,62 @@
|
||||
// Created on: 1997-03-17
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_Evolution_HeaderFile
|
||||
#define _TNaming_Evolution_HeaderFile
|
||||
|
||||
//! Defines the type of evolution in old shape - new shape pairs.
|
||||
//! The definitions - in the form of the terms of
|
||||
//! the enumeration - are needed by the
|
||||
//! TNaming_NamedShape attribute and
|
||||
//! indicate what entities this attribute records as follows:
|
||||
//! - PRIMITIVE
|
||||
//! - New entities; in each pair, old shape is a
|
||||
//! null shape and new shape is a created
|
||||
//! entity.
|
||||
//! - GENERATED
|
||||
//! - Entities created from other entities; in
|
||||
//! each pair, old shape is the generator and
|
||||
//! new shape is the created entity.
|
||||
//! - MODIFY
|
||||
//! - Split or merged entities, in each pair, old
|
||||
//! shape is the entity before the operation
|
||||
//! and new shape is the new entity after the
|
||||
//! operation.
|
||||
//! - DELETE
|
||||
//! - Deletion of entities; in each pair, old
|
||||
//! shape is a deleted entity and new shape is null.
|
||||
//! - SELECTED
|
||||
//! - Named topological entities; in each pair,
|
||||
//! the new shape is a named entity and the
|
||||
//! old shape is not used.
|
||||
//!
|
||||
//! For a split which generates multiple faces, the
|
||||
//! attribute will contain many pairs with the same
|
||||
//! old shape; for a merge, it will contain many
|
||||
//! pairs with the same new shape.
|
||||
//! Finally, an example of delete would be a face
|
||||
//! removed by a Boolean operation.
|
||||
enum TNaming_Evolution
|
||||
{
|
||||
TNaming_PRIMITIVE,
|
||||
TNaming_GENERATED,
|
||||
TNaming_MODIFY,
|
||||
TNaming_DELETE,
|
||||
TNaming_REPLACE,
|
||||
TNaming_SELECTED
|
||||
};
|
||||
|
||||
#endif // _TNaming_Evolution_HeaderFile
|
@@ -1,111 +0,0 @@
|
||||
-- Created on: 1997-03-03
|
||||
-- Created by: Yves FRICAUD
|
||||
-- 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.
|
||||
|
||||
private class Identifier from TNaming
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
|
||||
Label from TDF,
|
||||
Shape from TopoDS,
|
||||
NamedShape from TNaming,
|
||||
ListOfNamedShape from TNaming,
|
||||
ListOfShape from TopTools,
|
||||
NameType from TNaming,
|
||||
Localizer from TNaming
|
||||
is
|
||||
|
||||
Create (Lab : Label from TDF;
|
||||
S : Shape from TopoDS;
|
||||
Context : Shape from TopoDS;
|
||||
Geom : Boolean from Standard)
|
||||
returns Identifier from TNaming;
|
||||
|
||||
Create (Lab : Label from TDF;
|
||||
S : Shape from TopoDS;
|
||||
ContextNS : NamedShape from TNaming;
|
||||
Geom : Boolean from Standard)
|
||||
returns Identifier from TNaming;
|
||||
|
||||
|
||||
|
||||
---Category: Querying
|
||||
|
||||
IsDone (me) returns Boolean from Standard;
|
||||
|
||||
Type (me) returns NameType from TNaming;
|
||||
|
||||
IsFeature (me : in out) returns Boolean from Standard;
|
||||
|
||||
Feature (me) returns NamedShape from TNaming;
|
||||
|
||||
|
||||
InitArgs (me : in out);
|
||||
|
||||
MoreArgs (me) returns Boolean from Standard;
|
||||
|
||||
NextArg (me : in out);
|
||||
|
||||
ArgIsFeature(me) returns Boolean from Standard;
|
||||
|
||||
FeatureArg (me : in out) returns NamedShape from TNaming;
|
||||
|
||||
ShapeArg (me : in out) returns Shape from TopoDS;
|
||||
|
||||
ShapeContext (me) returns Shape from TopoDS;
|
||||
|
||||
NamedShapeOfGeneration (me) returns NamedShape from TNaming;
|
||||
|
||||
---Category: Private methods.
|
||||
|
||||
AncestorIdentification(me : in out;
|
||||
Localizer : in out Localizer from TNaming;
|
||||
Context : Shape from TopoDS);
|
||||
|
||||
PrimitiveIdentification(me : in out;
|
||||
Localizer : in out Localizer from TNaming;
|
||||
NS : NamedShape from TNaming);
|
||||
|
||||
GeneratedIdentification(me : in out;
|
||||
Localizer : in out Localizer from TNaming;
|
||||
NS : NamedShape from TNaming);
|
||||
|
||||
|
||||
Identification(me : in out;
|
||||
Localizer : in out Localizer from TNaming;
|
||||
NS : NamedShape from TNaming);
|
||||
|
||||
|
||||
Init(me : in out; Context : Shape from TopoDS) is private;
|
||||
|
||||
fields
|
||||
|
||||
myTDFAcces : Label from TDF;
|
||||
myShape : Shape from TopoDS;
|
||||
|
||||
myDone : Boolean from Standard;
|
||||
|
||||
myIsFeature : Boolean from Standard;
|
||||
myType : NameType from TNaming;
|
||||
myFeature : NamedShape from TNaming;
|
||||
myPrimitiveArgs : ListOfNamedShape from TNaming;
|
||||
myShapeArgs : ListOfShape from TopTools;
|
||||
myNSContext : NamedShape from TNaming;
|
||||
|
||||
end Identifier;
|
||||
|
||||
|
@@ -14,17 +14,20 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_Identifier.ixx>
|
||||
#include <TNaming_Localizer.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_UsedShapes.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_MapOfNamedShape.hxx>
|
||||
#include <TNaming_MapIteratorOfMapOfNamedShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TNaming_Identifier.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_Localizer.hxx>
|
||||
#include <TNaming_MapIteratorOfMapOfNamedShape.hxx>
|
||||
#include <TNaming_MapOfNamedShape.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_UsedShapes.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
|
||||
//#define MDTV_DEB_IDF
|
||||
#ifdef OCCT_DEBUG_IDF
|
||||
|
114
src/TNaming/TNaming_Identifier.hxx
Normal file
114
src/TNaming/TNaming_Identifier.hxx
Normal file
@@ -0,0 +1,114 @@
|
||||
// Created on: 1997-03-03
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_Identifier_HeaderFile
|
||||
#define _TNaming_Identifier_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TNaming_NameType.hxx>
|
||||
#include <TNaming_ListOfNamedShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
class TNaming_NamedShape;
|
||||
class TDF_Label;
|
||||
class TopoDS_Shape;
|
||||
class TNaming_Localizer;
|
||||
|
||||
|
||||
|
||||
class TNaming_Identifier
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT TNaming_Identifier(const TDF_Label& Lab, const TopoDS_Shape& S, const TopoDS_Shape& Context, const Standard_Boolean Geom);
|
||||
|
||||
Standard_EXPORT TNaming_Identifier(const TDF_Label& Lab, const TopoDS_Shape& S, const Handle(TNaming_NamedShape)& ContextNS, const Standard_Boolean Geom);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
Standard_EXPORT TNaming_NameType Type() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsFeature();
|
||||
|
||||
Standard_EXPORT Handle(TNaming_NamedShape) Feature() const;
|
||||
|
||||
Standard_EXPORT void InitArgs();
|
||||
|
||||
Standard_EXPORT Standard_Boolean MoreArgs() const;
|
||||
|
||||
Standard_EXPORT void NextArg();
|
||||
|
||||
Standard_EXPORT Standard_Boolean ArgIsFeature() const;
|
||||
|
||||
Standard_EXPORT Handle(TNaming_NamedShape) FeatureArg();
|
||||
|
||||
Standard_EXPORT TopoDS_Shape ShapeArg();
|
||||
|
||||
Standard_EXPORT TopoDS_Shape ShapeContext() const;
|
||||
|
||||
Standard_EXPORT Handle(TNaming_NamedShape) NamedShapeOfGeneration() const;
|
||||
|
||||
Standard_EXPORT void AncestorIdentification (TNaming_Localizer& Localizer, const TopoDS_Shape& Context);
|
||||
|
||||
Standard_EXPORT void PrimitiveIdentification (TNaming_Localizer& Localizer, const Handle(TNaming_NamedShape)& NS);
|
||||
|
||||
Standard_EXPORT void GeneratedIdentification (TNaming_Localizer& Localizer, const Handle(TNaming_NamedShape)& NS);
|
||||
|
||||
Standard_EXPORT void Identification (TNaming_Localizer& Localizer, const Handle(TNaming_NamedShape)& NS);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Init (const TopoDS_Shape& Context);
|
||||
|
||||
|
||||
TDF_Label myTDFAcces;
|
||||
TopoDS_Shape myShape;
|
||||
Standard_Boolean myDone;
|
||||
Standard_Boolean myIsFeature;
|
||||
TNaming_NameType myType;
|
||||
Handle(TNaming_NamedShape) myFeature;
|
||||
TNaming_ListOfNamedShape myPrimitiveArgs;
|
||||
TopTools_ListOfShape myShapeArgs;
|
||||
Handle(TNaming_NamedShape) myNSContext;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_Identifier_HeaderFile
|
@@ -1,98 +0,0 @@
|
||||
-- Created on: 1996-12-16
|
||||
-- Created by: Remi Lequette
|
||||
-- Copyright (c) 1996-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.
|
||||
|
||||
class Iterator from TNaming
|
||||
|
||||
---Purpose: A tool to visit the contents of a named shape attribute.
|
||||
-- Pairs of shapes in the attribute are iterated, one
|
||||
-- being the pre-modification or the old shape, and
|
||||
-- the other the post-modification or the new shape.
|
||||
-- This allows you to have a full access to all
|
||||
-- contents of an attribute. If, on the other hand, you
|
||||
-- are only interested in topological entities stored
|
||||
-- in the attribute, you can use the functions
|
||||
-- GetShape and CurrentShape in TNaming_Tool.
|
||||
|
||||
uses
|
||||
|
||||
Label from TDF,
|
||||
Evolution from TNaming,
|
||||
NamedShape from TNaming,
|
||||
PtrNode from TNaming,
|
||||
Shape from TopoDS
|
||||
|
||||
raises
|
||||
|
||||
NoMoreObject from Standard,
|
||||
NoSuchObject from Standard
|
||||
|
||||
is
|
||||
|
||||
Create( anAtt : NamedShape from TNaming) returns Iterator from TNaming;
|
||||
---Purpose: Iterates on all the history records in
|
||||
-- <anAtt>.
|
||||
|
||||
Create( aLabel : Label from TDF) returns Iterator from TNaming;
|
||||
---Purpose: Iterates on all the history records in
|
||||
-- the current transaction
|
||||
|
||||
Create( aLabel : Label from TDF; aTrans : Integer from Standard)
|
||||
returns Iterator from TNaming;
|
||||
---Purpose: Iterates on all the history records in
|
||||
-- the transaction <aTrans>
|
||||
|
||||
More(me) returns Boolean;
|
||||
---C++: inline
|
||||
---Purpose: Returns True if there is a current Item in
|
||||
-- the iteration.
|
||||
|
||||
Next(me : in out)
|
||||
---Purpose: Moves the iteration to the next Item
|
||||
raises
|
||||
NoMoreObject from Standard;
|
||||
|
||||
OldShape(me) returns Shape from TopoDS
|
||||
---Purpose: Returns the old shape in this iterator object.
|
||||
-- This shape can be a null one.
|
||||
---C++: return const&
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
NewShape(me) returns Shape from TopoDS
|
||||
---Purpose: Returns the new shape in this iterator object.
|
||||
---C++: return const&
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
IsModification(me) returns Boolean;
|
||||
---Purpose: Returns true if the new shape is a modification (split,
|
||||
-- fuse,etc...) of the old shape.
|
||||
--
|
||||
|
||||
Evolution(me) returns Evolution from TNaming;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myNode : PtrNode from TNaming;
|
||||
myTrans : Integer from Standard; -- is < 0 means in Current Transaction.
|
||||
|
||||
friends
|
||||
|
||||
class NewShapeIterator from TNaming,
|
||||
class OldShapeIterator from TNaming
|
||||
|
||||
end Iterator;
|
@@ -14,6 +14,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_Iterator.ixx>
|
||||
|
||||
#include <Standard_NoMoreObject.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_NewShapeIterator.hxx>
|
||||
#include <TNaming_OldShapeIterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
// See methods'bodies in TNaming_NamedShape.cxx
|
||||
|
113
src/TNaming/TNaming_Iterator.hxx
Normal file
113
src/TNaming/TNaming_Iterator.hxx
Normal file
@@ -0,0 +1,113 @@
|
||||
// Created on: 1996-12-16
|
||||
// Created by: Remi Lequette
|
||||
// Copyright (c) 1996-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 _TNaming_Iterator_HeaderFile
|
||||
#define _TNaming_Iterator_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TNaming_PtrNode.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TNaming_Evolution.hxx>
|
||||
class Standard_NoMoreObject;
|
||||
class Standard_NoSuchObject;
|
||||
class TNaming_NewShapeIterator;
|
||||
class TNaming_OldShapeIterator;
|
||||
class TNaming_NamedShape;
|
||||
class TDF_Label;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
//! A tool to visit the contents of a named shape attribute.
|
||||
//! Pairs of shapes in the attribute are iterated, one
|
||||
//! being the pre-modification or the old shape, and
|
||||
//! the other the post-modification or the new shape.
|
||||
//! This allows you to have a full access to all
|
||||
//! contents of an attribute. If, on the other hand, you
|
||||
//! are only interested in topological entities stored
|
||||
//! in the attribute, you can use the functions
|
||||
//! GetShape and CurrentShape in TNaming_Tool.
|
||||
class TNaming_Iterator
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Iterates on all the history records in
|
||||
//! <anAtt>.
|
||||
Standard_EXPORT TNaming_Iterator(const Handle(TNaming_NamedShape)& anAtt);
|
||||
|
||||
//! Iterates on all the history records in
|
||||
//! the current transaction
|
||||
Standard_EXPORT TNaming_Iterator(const TDF_Label& aLabel);
|
||||
|
||||
//! Iterates on all the history records in
|
||||
//! the transaction <aTrans>
|
||||
Standard_EXPORT TNaming_Iterator(const TDF_Label& aLabel, const Standard_Integer aTrans);
|
||||
|
||||
//! Returns True if there is a current Item in
|
||||
//! the iteration.
|
||||
Standard_Boolean More() const;
|
||||
|
||||
//! Moves the iteration to the next Item
|
||||
Standard_EXPORT void Next();
|
||||
|
||||
//! Returns the old shape in this iterator object.
|
||||
//! This shape can be a null one.
|
||||
Standard_EXPORT const TopoDS_Shape& OldShape() const;
|
||||
|
||||
//! Returns the new shape in this iterator object.
|
||||
Standard_EXPORT const TopoDS_Shape& NewShape() const;
|
||||
|
||||
//! Returns true if the new shape is a modification (split,
|
||||
//! fuse,etc...) of the old shape.
|
||||
Standard_EXPORT Standard_Boolean IsModification() const;
|
||||
|
||||
Standard_EXPORT TNaming_Evolution Evolution() const;
|
||||
|
||||
|
||||
friend class TNaming_NewShapeIterator;
|
||||
friend class TNaming_OldShapeIterator;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
TNaming_PtrNode myNode;
|
||||
Standard_Integer myTrans;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <TNaming_Iterator.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_Iterator_HeaderFile
|
@@ -1,61 +0,0 @@
|
||||
-- Created on: 1997-05-06
|
||||
-- Created by: Yves FRICAUD
|
||||
-- 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.
|
||||
|
||||
private class IteratorOnShapesSet from TNaming
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
ShapesSet from TNaming,
|
||||
Shape from TopoDS,
|
||||
MapIteratorOfMapOfShape from TopTools
|
||||
|
||||
raises
|
||||
NoMoreObject from Standard,
|
||||
NoSuchObject from Standard
|
||||
|
||||
is
|
||||
Create returns IteratorOnShapesSet;
|
||||
---C++: inline
|
||||
|
||||
Create (S : ShapesSet from TNaming) returns IteratorOnShapesSet;
|
||||
---C++: inline
|
||||
|
||||
Init (me : in out; S : ShapesSet from TNaming);
|
||||
---Purpose: Initialize the iteration
|
||||
---C++: inline
|
||||
|
||||
More (me) returns Boolean;
|
||||
---Purpose: Returns True if there is a current Item in
|
||||
-- the iteration.
|
||||
---C++: inline
|
||||
|
||||
Next (me : in out)
|
||||
---Purpose: Move to the next Item
|
||||
---C++: inline
|
||||
raises
|
||||
NoMoreObject from Standard;
|
||||
|
||||
Value(me) returns Shape from TopoDS
|
||||
---C++: return const&
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
|
||||
fields
|
||||
myIt : MapIteratorOfMapOfShape from TopTools;
|
||||
|
||||
end IteratorOnShapesSet;
|
@@ -14,4 +14,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_IteratorOnShapesSet.ixx>
|
||||
|
||||
#include <Standard_NoMoreObject.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <TNaming_IteratorOnShapesSet.hxx>
|
||||
#include <TNaming_ShapesSet.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
81
src/TNaming/TNaming_IteratorOnShapesSet.hxx
Normal file
81
src/TNaming/TNaming_IteratorOnShapesSet.hxx
Normal file
@@ -0,0 +1,81 @@
|
||||
// Created on: 1997-05-06
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_IteratorOnShapesSet_HeaderFile
|
||||
#define _TNaming_IteratorOnShapesSet_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_NoMoreObject;
|
||||
class Standard_NoSuchObject;
|
||||
class TNaming_ShapesSet;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
|
||||
class TNaming_IteratorOnShapesSet
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
TNaming_IteratorOnShapesSet();
|
||||
|
||||
TNaming_IteratorOnShapesSet(const TNaming_ShapesSet& S);
|
||||
|
||||
//! Initialize the iteration
|
||||
void Init (const TNaming_ShapesSet& S);
|
||||
|
||||
//! Returns True if there is a current Item in
|
||||
//! the iteration.
|
||||
Standard_Boolean More() const;
|
||||
|
||||
//! Move to the next Item
|
||||
void Next();
|
||||
|
||||
Standard_EXPORT const TopoDS_Shape& Value() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
TopTools_MapIteratorOfMapOfShape myIt;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <TNaming_IteratorOnShapesSet.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_IteratorOnShapesSet_HeaderFile
|
@@ -1,115 +0,0 @@
|
||||
-- Created on: 1997-06-10
|
||||
-- Created by: Yves FRICAUD
|
||||
-- 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.
|
||||
|
||||
private class Localizer from TNaming
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
ShapeEnum from TopAbs,
|
||||
Label from TDF,
|
||||
LabelList from TDF,
|
||||
LabelMap from TDF,
|
||||
UsedShapes from TNaming,
|
||||
NamedShape from TNaming,
|
||||
MapOfNamedShape from TNaming,
|
||||
ListOfNamedShape from TNaming,
|
||||
Evolution from TNaming,
|
||||
ShapesSet from TNaming,
|
||||
ListOfShape from TopTools,
|
||||
MapOfShape from TopTools,
|
||||
IndexedDataMapOfShapeListOfShape from TopTools,
|
||||
ListOfMapOfShape from TNaming,
|
||||
ListOfIndexedDataMapOfShapeListOfShape from TNaming
|
||||
|
||||
is
|
||||
|
||||
|
||||
Create returns Localizer from TNaming;
|
||||
|
||||
Init (me : in out;
|
||||
US : UsedShapes from TNaming;
|
||||
CurTrans : Integer from Standard );
|
||||
|
||||
SubShapes (me : in out; S : Shape from TopoDS; Type : ShapeEnum from TopAbs)
|
||||
returns MapOfShape from TopTools;
|
||||
---C++: return const&
|
||||
|
||||
Ancestors (me : in out; S : Shape from TopoDS; Type : ShapeEnum from TopAbs)
|
||||
returns IndexedDataMapOfShapeListOfShape from TopTools;
|
||||
---C++: return const&
|
||||
|
||||
FindFeaturesInAncestors (me : in out;
|
||||
S : Shape from TopoDS;
|
||||
In : Shape from TopoDS;
|
||||
AncInFeatures : in out MapOfShape from TopTools);
|
||||
|
||||
|
||||
GoBack (me : in out;
|
||||
S : Shape from TopoDS;
|
||||
Lab : Label from TDF;
|
||||
Evol : Evolution from TNaming;
|
||||
OldS : in out ListOfShape from TopTools;
|
||||
OldLab : in out ListOfNamedShape from TNaming);
|
||||
|
||||
|
||||
Backward (me : in out;
|
||||
NS : NamedShape from TNaming;
|
||||
S : Shape from TopoDS;
|
||||
Primitives : in out MapOfNamedShape from TNaming;
|
||||
ValidShapes : in out MapOfShape from TopTools);
|
||||
|
||||
FindNeighbourg (me : in out;
|
||||
Cont : Shape from TopoDS;
|
||||
S : Shape from TopoDS;
|
||||
Neighbourg : in out MapOfShape from TopTools);
|
||||
|
||||
IsNew (myclass ;S : Shape from TopoDS;
|
||||
NS : NamedShape from TNaming)
|
||||
returns Boolean from Standard;
|
||||
|
||||
FindGenerator (myclass ; NS : NamedShape from TNaming;
|
||||
S : Shape from TopoDS;
|
||||
theListOfGenerators : in out ListOfShape from TopTools );
|
||||
|
||||
|
||||
FindShapeContext (myclass ; NS : NamedShape from TNaming;
|
||||
theS : Shape from TopoDS;
|
||||
theSC : in out Shape from TopoDS);
|
||||
---Purpose: Finds context of the shape <S>.
|
||||
|
||||
fields
|
||||
|
||||
myCurTrans : Integer from Standard;
|
||||
myUS : UsedShapes from TNaming;
|
||||
|
||||
myShapeWithSubShapes : ListOfShape from TopTools;
|
||||
mySubShapes : ListOfMapOfShape from TNaming;
|
||||
|
||||
myShapeWithAncestors : ListOfShape from TopTools;
|
||||
myAncestors : ListOfIndexedDataMapOfShapeListOfShape from TNaming;
|
||||
|
||||
end Localizer;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -14,28 +14,32 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_Localizer.ixx>
|
||||
#include <TNaming_Identifier.hxx>
|
||||
#include <TNaming_ShapesSet.hxx>
|
||||
#include <TNaming_ListIteratorOfListOfMapOfShape.hxx>
|
||||
#include <TNaming_ListIteratorOfListOfIndexedDataMapOfShapeListOfShape.hxx>
|
||||
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TNaming_DataMapOfShapeShapesSet.hxx>
|
||||
#include <TNaming_IteratorOnShapesSet.hxx>
|
||||
#include <TNaming_Evolution.hxx>
|
||||
#include <TNaming_Identifier.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_IteratorOnShapesSet.hxx>
|
||||
#include <TNaming_ListIteratorOfListOfIndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TNaming_ListIteratorOfListOfMapOfShape.hxx>
|
||||
#include <TNaming_ListIteratorOfListOfNamedShape.hxx>
|
||||
#include <TNaming_ListOfNamedShape.hxx>
|
||||
#include <TNaming_Localizer.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_NewShapeIterator.hxx>
|
||||
#include <TNaming_OldShapeIterator.hxx>
|
||||
#include <TNaming_ShapesSet.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_ListOfNamedShape.hxx>
|
||||
#include <TNaming_ListIteratorOfListOfNamedShape.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TNaming_UsedShapes.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
|
||||
#ifdef OCCT_DEBUG
|
||||
//#define MDTV_DEB_SC
|
||||
|
101
src/TNaming/TNaming_Localizer.hxx
Normal file
101
src/TNaming/TNaming_Localizer.hxx
Normal file
@@ -0,0 +1,101 @@
|
||||
// Created on: 1997-06-10
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_Localizer_HeaderFile
|
||||
#define _TNaming_Localizer_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TNaming_ListOfMapOfShape.hxx>
|
||||
#include <TNaming_ListOfIndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TNaming_Evolution.hxx>
|
||||
#include <TNaming_ListOfNamedShape.hxx>
|
||||
#include <TNaming_MapOfNamedShape.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class TNaming_UsedShapes;
|
||||
class TopoDS_Shape;
|
||||
class TDF_Label;
|
||||
class TNaming_NamedShape;
|
||||
|
||||
|
||||
|
||||
class TNaming_Localizer
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT TNaming_Localizer();
|
||||
|
||||
Standard_EXPORT void Init (const Handle(TNaming_UsedShapes)& US, const Standard_Integer CurTrans);
|
||||
|
||||
Standard_EXPORT const TopTools_MapOfShape& SubShapes (const TopoDS_Shape& S, const TopAbs_ShapeEnum Type);
|
||||
|
||||
Standard_EXPORT const TopTools_IndexedDataMapOfShapeListOfShape& Ancestors (const TopoDS_Shape& S, const TopAbs_ShapeEnum Type);
|
||||
|
||||
Standard_EXPORT void FindFeaturesInAncestors (const TopoDS_Shape& S, const TopoDS_Shape& In, TopTools_MapOfShape& AncInFeatures);
|
||||
|
||||
Standard_EXPORT void GoBack (const TopoDS_Shape& S, const TDF_Label& Lab, const TNaming_Evolution Evol, TopTools_ListOfShape& OldS, TNaming_ListOfNamedShape& OldLab);
|
||||
|
||||
Standard_EXPORT void Backward (const Handle(TNaming_NamedShape)& NS, const TopoDS_Shape& S, TNaming_MapOfNamedShape& Primitives, TopTools_MapOfShape& ValidShapes);
|
||||
|
||||
Standard_EXPORT void FindNeighbourg (const TopoDS_Shape& Cont, const TopoDS_Shape& S, TopTools_MapOfShape& Neighbourg);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean IsNew (const TopoDS_Shape& S, const Handle(TNaming_NamedShape)& NS);
|
||||
|
||||
Standard_EXPORT static void FindGenerator (const Handle(TNaming_NamedShape)& NS, const TopoDS_Shape& S, TopTools_ListOfShape& theListOfGenerators);
|
||||
|
||||
//! Finds context of the shape <S>.
|
||||
Standard_EXPORT static void FindShapeContext (const Handle(TNaming_NamedShape)& NS, const TopoDS_Shape& theS, TopoDS_Shape& theSC);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Integer myCurTrans;
|
||||
Handle(TNaming_UsedShapes) myUS;
|
||||
TopTools_ListOfShape myShapeWithSubShapes;
|
||||
TNaming_ListOfMapOfShape mySubShapes;
|
||||
TopTools_ListOfShape myShapeWithAncestors;
|
||||
TNaming_ListOfIndexedDataMapOfShapeListOfShape myAncestors;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_Localizer_HeaderFile
|
@@ -1,106 +0,0 @@
|
||||
-- Created on: 1997-03-19
|
||||
-- Created by: Yves FRICAUD
|
||||
-- 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.
|
||||
|
||||
-- Modified by SZY Wed Aug 18 1999
|
||||
|
||||
|
||||
class Name from TNaming
|
||||
---Purpose: store the arguments of Naming.
|
||||
uses
|
||||
|
||||
NameType from TNaming,
|
||||
NamedShape from TNaming,
|
||||
ListOfNamedShape from TNaming,
|
||||
ShapeEnum from TopAbs,
|
||||
Orientation from TopAbs,
|
||||
Shape from TopoDS,
|
||||
Label from TDF,
|
||||
LabelMap from TDF,
|
||||
RelocationTable from TDF
|
||||
|
||||
is
|
||||
|
||||
---Category: Construction
|
||||
-- ============
|
||||
|
||||
Create returns Name from TNaming;
|
||||
|
||||
Type (me : in out; aType : NameType from TNaming);
|
||||
|
||||
ShapeType (me : in out; aType : ShapeEnum from TopAbs);
|
||||
|
||||
Shape (me : in out; theShape : Shape from TopoDS);
|
||||
|
||||
Append (me : in out; arg : NamedShape from TNaming);
|
||||
|
||||
StopNamedShape (me : in out; arg : NamedShape from TNaming);
|
||||
|
||||
Index (me : in out; I : Integer from Standard);
|
||||
|
||||
ContextLabel (me : in out; theLab : Label from TDF);
|
||||
|
||||
Orientation (me : in out; theOrientation : Orientation from TopAbs);
|
||||
|
||||
|
||||
---Category: Queriyng
|
||||
-- ========
|
||||
|
||||
Type (me) returns NameType from TNaming;
|
||||
|
||||
ShapeType (me) returns ShapeEnum from TopAbs;
|
||||
|
||||
Shape (me) returns Shape from TopoDS;
|
||||
|
||||
Arguments (me) returns ListOfNamedShape from TNaming;
|
||||
---Purpose:
|
||||
---C++: return const&
|
||||
|
||||
StopNamedShape (me) returns NamedShape from TNaming ;
|
||||
|
||||
Index (me) returns Integer from Standard;
|
||||
|
||||
ContextLabel (me) returns Label from TDF;
|
||||
---C++: return const&
|
||||
|
||||
Orientation (me) returns Orientation from TopAbs;
|
||||
---C++: inline
|
||||
---C++: return const
|
||||
|
||||
|
||||
---Category: Resolution
|
||||
-- ==========
|
||||
|
||||
Solve(me;
|
||||
aLab : Label from TDF;
|
||||
Valid : LabelMap from TDF)
|
||||
returns Boolean from Standard;
|
||||
|
||||
Paste (me;
|
||||
into : in out Name from TNaming;
|
||||
RT : RelocationTable from TDF);
|
||||
|
||||
fields
|
||||
|
||||
myType : NameType from TNaming;
|
||||
myShapeType : ShapeEnum from TopAbs;
|
||||
myArgs : ListOfNamedShape from TNaming;
|
||||
myStop : NamedShape from TNaming;
|
||||
myIndex : Integer from Standard;
|
||||
myShape : Shape from TopoDS;
|
||||
myContextLabel : Label from TDF;
|
||||
myOrientation : Orientation from TopAbs;
|
||||
|
||||
end Name;
|
@@ -14,60 +14,56 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_Name.ixx>
|
||||
#include <TNaming.hxx>
|
||||
#include <TNaming_NamingTool.hxx>
|
||||
#include <TNaming_Naming.hxx>
|
||||
#include <TNaming_ShapesSet.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_NewShapeIterator.hxx>
|
||||
#include <TNaming_ListOfNamedShape.hxx>
|
||||
#include <TNaming_ListIteratorOfListOfNamedShape.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <BRepBuilderAPI_MakeSolid.hxx>
|
||||
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_LabelList.hxx>
|
||||
#include <TDF_LabelMap.hxx>
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
#include <TNaming.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_ListIteratorOfListOfNamedShape.hxx>
|
||||
#include <TNaming_ListOfNamedShape.hxx>
|
||||
#include <TNaming_Name.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Naming.hxx>
|
||||
#include <TNaming_NamingTool.hxx>
|
||||
#include <TNaming_NCollections.hxx>
|
||||
#include <TNaming_NewShapeIterator.hxx>
|
||||
#include <TNaming_ShapesSet.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
#include <TopTools_Array1OfShape.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_CompSolid.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopTools_Array1OfShape.hxx>
|
||||
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_DataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_HArray2OfShape.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
|
||||
// mpv modifications 08.04.2002
|
||||
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_CompSolid.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <BRepBuilderAPI_MakeSolid.hxx>
|
||||
#include <TopTools_HArray2OfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_DataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
|
||||
// end of mpv modifications 08.04.2002
|
||||
|
||||
#include <TNaming_NCollections.hxx>
|
||||
|
||||
#ifdef OCCT_DEBUG_DBGTOOLS_WRITE
|
||||
#define MDTV_DEB
|
||||
#define MDTV_DEB_OR
|
||||
|
117
src/TNaming/TNaming_Name.hxx
Normal file
117
src/TNaming/TNaming_Name.hxx
Normal file
@@ -0,0 +1,117 @@
|
||||
// Created on: 1997-03-19
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_Name_HeaderFile
|
||||
#define _TNaming_Name_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TNaming_NameType.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <TNaming_ListOfNamedShape.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TopAbs_Orientation.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TDF_LabelMap.hxx>
|
||||
class TNaming_NamedShape;
|
||||
class TopoDS_Shape;
|
||||
class TDF_Label;
|
||||
class TDF_RelocationTable;
|
||||
|
||||
|
||||
//! store the arguments of Naming.
|
||||
class TNaming_Name
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT TNaming_Name();
|
||||
|
||||
Standard_EXPORT void Type (const TNaming_NameType aType);
|
||||
|
||||
Standard_EXPORT void ShapeType (const TopAbs_ShapeEnum aType);
|
||||
|
||||
Standard_EXPORT void Shape (const TopoDS_Shape& theShape);
|
||||
|
||||
Standard_EXPORT void Append (const Handle(TNaming_NamedShape)& arg);
|
||||
|
||||
Standard_EXPORT void StopNamedShape (const Handle(TNaming_NamedShape)& arg);
|
||||
|
||||
Standard_EXPORT void Index (const Standard_Integer I);
|
||||
|
||||
Standard_EXPORT void ContextLabel (const TDF_Label& theLab);
|
||||
|
||||
Standard_EXPORT void Orientation (const TopAbs_Orientation theOrientation);
|
||||
|
||||
Standard_EXPORT TNaming_NameType Type() const;
|
||||
|
||||
Standard_EXPORT TopAbs_ShapeEnum ShapeType() const;
|
||||
|
||||
Standard_EXPORT TopoDS_Shape Shape() const;
|
||||
|
||||
Standard_EXPORT const TNaming_ListOfNamedShape& Arguments() const;
|
||||
|
||||
Standard_EXPORT Handle(TNaming_NamedShape) StopNamedShape() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer Index() const;
|
||||
|
||||
Standard_EXPORT const TDF_Label& ContextLabel() const;
|
||||
|
||||
const TopAbs_Orientation Orientation() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean Solve (const TDF_Label& aLab, const TDF_LabelMap& Valid) const;
|
||||
|
||||
Standard_EXPORT void Paste (TNaming_Name& into, const Handle(TDF_RelocationTable)& RT) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
TNaming_NameType myType;
|
||||
TopAbs_ShapeEnum myShapeType;
|
||||
TNaming_ListOfNamedShape myArgs;
|
||||
Handle(TNaming_NamedShape) myStop;
|
||||
Standard_Integer myIndex;
|
||||
TopoDS_Shape myShape;
|
||||
TDF_Label myContextLabel;
|
||||
TopAbs_Orientation myOrientation;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <TNaming_Name.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_Name_HeaderFile
|
37
src/TNaming/TNaming_NameType.hxx
Normal file
37
src/TNaming/TNaming_NameType.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1997-03-17
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_NameType_HeaderFile
|
||||
#define _TNaming_NameType_HeaderFile
|
||||
|
||||
//! to store naming characteristcs
|
||||
enum TNaming_NameType
|
||||
{
|
||||
TNaming_UNKNOWN,
|
||||
TNaming_IDENTITY,
|
||||
TNaming_MODIFUNTIL,
|
||||
TNaming_GENERATION,
|
||||
TNaming_INTERSECTION,
|
||||
TNaming_UNION,
|
||||
TNaming_SUBSTRACTION,
|
||||
TNaming_CONSTSHAPE,
|
||||
TNaming_FILTERBYNEIGHBOURGS,
|
||||
TNaming_ORIENTATION,
|
||||
TNaming_WIREIN,
|
||||
TNaming_SHELLIN
|
||||
};
|
||||
|
||||
#endif // _TNaming_NameType_HeaderFile
|
@@ -1,188 +0,0 @@
|
||||
-- Created on: 1997-02-04
|
||||
-- Created by: Yves FRICAUD
|
||||
-- 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.
|
||||
|
||||
class NamedShape from TNaming inherits Attribute from TDF
|
||||
|
||||
---Purpose: The basis to define an attribute for the storage of
|
||||
-- topology and naming data.
|
||||
-- This attribute contains two parts:
|
||||
-- - The type of evolution, a term of the
|
||||
-- enumeration TNaming_Evolution
|
||||
-- - A list of pairs of shapes called the "old"
|
||||
-- shape and the "new" shape. The meaning
|
||||
-- depends on the type of evolution.
|
||||
|
||||
uses
|
||||
GUID from Standard,
|
||||
PtrNode from TNaming,
|
||||
Evolution from TNaming,
|
||||
DeltaOnModification from TDF,
|
||||
DeltaOnRemoval from TDF,
|
||||
RelocationTable from TDF,
|
||||
AttributeIndexedMap from TDF,
|
||||
Attribute from TDF,
|
||||
AttributeDelta from TDF,
|
||||
Delta from TDF,
|
||||
DataSet from TDF,
|
||||
Shape from TopoDS
|
||||
|
||||
|
||||
is
|
||||
|
||||
---Purpose: class method
|
||||
-- ============
|
||||
|
||||
GetID(myclass) returns GUID from Standard;
|
||||
---Purpose: Returns the GUID for named shapes.
|
||||
---C++: return const &
|
||||
|
||||
Create returns NamedShape from TNaming;
|
||||
|
||||
|
||||
IsEmpty (me)
|
||||
returns Boolean from Standard;
|
||||
|
||||
Get (me)
|
||||
---Purpose: Returns the shapes contained in <NS>. Returns a null
|
||||
-- shape if IsEmpty.
|
||||
returns Shape from TopoDS;
|
||||
|
||||
|
||||
Evolution (me) returns Evolution from TNaming;
|
||||
---Purpose: Returns the Evolution of the attribute.
|
||||
---C++: inline
|
||||
|
||||
Version (me) returns Integer from Standard;
|
||||
---Purpose: Returns the Version of the attribute.
|
||||
---C++: inline
|
||||
|
||||
SetVersion (me : mutable; version : Integer from Standard);
|
||||
---Purpose: Set the Version of the attribute.
|
||||
---C++: inline
|
||||
|
||||
Clear (me : mutable);
|
||||
---C++: alias ~
|
||||
|
||||
ID(me) returns GUID from Standard
|
||||
is redefined static;
|
||||
---Purpose: Returns the ID of the attribute.
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
BackupCopy(me) returns Attribute from TDF
|
||||
is redefined;
|
||||
---Purpose: Copies the attribute contents into a new other
|
||||
-- attribute. It is used by Backup().
|
||||
|
||||
Restore(me: mutable; anAttribute : Attribute from TDF)
|
||||
is redefined;
|
||||
---Purpose: Restores the contents from <anAttribute> into this
|
||||
-- one. It is used when aborting a transaction.
|
||||
--
|
||||
|
||||
-- Delta use methods
|
||||
-- -----------------
|
||||
|
||||
DeltaOnModification(me; anOldAttribute : Attribute from TDF)
|
||||
returns DeltaOnModification from TDF
|
||||
---Purpose : Makes a DeltaOnModification between <me> and
|
||||
-- <anOldAttribute.
|
||||
is redefined virtual;
|
||||
|
||||
DeltaOnModification(me : mutable; aDelta : DeltaOnModification from TDF)
|
||||
is redefined virtual;
|
||||
---Purpose: Applies a DeltaOnModification to <me>.
|
||||
|
||||
DeltaOnRemoval(me)
|
||||
returns DeltaOnRemoval from TDF
|
||||
---Purpose : Makes a DeltaOnRemoval on <me> because <me> has
|
||||
-- disappeared from the DS.
|
||||
is redefined virtual;
|
||||
|
||||
|
||||
-- Copy use methods
|
||||
-- ----------------
|
||||
|
||||
NewEmpty(me)
|
||||
returns Attribute from TDF
|
||||
is redefined;
|
||||
---Purpose: Returns an new empty attribute from the good end
|
||||
-- type. It is used by the copy algorithm.
|
||||
|
||||
Paste(me;
|
||||
intoAttribute : Attribute from TDF;
|
||||
aRelocTationable : RelocationTable from TDF)
|
||||
is redefined;
|
||||
---Purpose: This method is different from the "Copy" one,
|
||||
-- because it is used when copying an attribute from
|
||||
-- a source structure into a target structure. This
|
||||
-- method pastes the current attribute to the label
|
||||
-- corresponding to the insertor. The pasted
|
||||
-- attribute may be a brand new one or a new version
|
||||
-- of the previous one.
|
||||
|
||||
References(me; aDataSet : DataSet from TDF)
|
||||
is redefined;
|
||||
---Purpose: Adds the directly referenced attributes and labels
|
||||
-- to <aDataSet>. "Directly" means we have only to
|
||||
-- look at the first level of references.
|
||||
|
||||
|
||||
BeforeRemoval(me: mutable) is redefined;
|
||||
|
||||
BeforeUndo(me: mutable;
|
||||
anAttDelta : AttributeDelta from TDF;
|
||||
forceIt : Boolean from Standard = Standard_False)
|
||||
returns Boolean from Standard
|
||||
is redefined;
|
||||
---Purpose: Something to do before applying <anAttDelta>
|
||||
|
||||
AfterUndo(me: mutable;
|
||||
anAttDelta : AttributeDelta from TDF;
|
||||
forceIt : Boolean from Standard = Standard_False)
|
||||
returns Boolean from Standard
|
||||
is redefined;
|
||||
---Purpose: Something to do after applying <anAttDelta>.
|
||||
|
||||
|
||||
-- Methods to build contents of the TNaming attribute
|
||||
-- This methods are private. the only one way to build
|
||||
-- an Attribute is to use the TNaming_Builder.
|
||||
-----------------------------------------------------
|
||||
|
||||
Add(me : mutable ; Evolution : in out PtrNode from TNaming)
|
||||
---Purpose: Adds an evolution
|
||||
is private;
|
||||
|
||||
|
||||
Dump(me; anOS : in out OStream from Standard)
|
||||
returns OStream from Standard
|
||||
is redefined ;
|
||||
---Purpose: Dumps the attribute on <aStream>.
|
||||
---C++: return &
|
||||
|
||||
fields
|
||||
myNode : PtrNode from TNaming;
|
||||
myEvolution : Evolution from TNaming;
|
||||
myVersion : Integer from Standard;
|
||||
|
||||
friends
|
||||
class Builder from TNaming,
|
||||
class Iterator from TNaming,
|
||||
class NewShapeIterator from TNaming,
|
||||
class OldShapeIterator from TNaming
|
||||
|
||||
end Attribute;
|
@@ -14,45 +14,49 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_NamedShape.ixx>
|
||||
#include <TNaming_Builder.ixx>
|
||||
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_Data.hxx>
|
||||
#include <TDF_DeltaOnAddition.hxx>
|
||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_NoMoreObject.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_AttributeDelta.hxx>
|
||||
#include <TDF_AttributeIterator.hxx>
|
||||
#include <TDF_Data.hxx>
|
||||
#include <TDF_DataSet.hxx>
|
||||
#include <TDF_DeltaOnAddition.hxx>
|
||||
#include <TDF_DeltaOnModification.hxx>
|
||||
#include <TDF_DeltaOnRemoval.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_CopyShape.hxx>
|
||||
#include <TNaming_DeltaOnModification.hxx>
|
||||
#include <TNaming_DeltaOnRemoval.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_NewShapeIterator.hxx>
|
||||
#include <TNaming_OldShapeIterator.hxx>
|
||||
#include <TNaming_PtrNode.hxx>
|
||||
#include <TNaming_PtrRefShape.hxx>
|
||||
#include <TNaming_RefShape.hxx>
|
||||
#include <TNaming_UsedShapes.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_NewShapeIterator.hxx>
|
||||
#include <TNaming_OldShapeIterator.hxx>
|
||||
#include <TNaming_SameShapeIterator.hxx>
|
||||
|
||||
#include <TNaming_DeltaOnModification.hxx>
|
||||
#include <TNaming_DeltaOnRemoval.hxx>
|
||||
#include <Standard_NoMoreObject.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_UsedShapes.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
// Defines the nodes classes
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <TNaming_CopyShape.hxx>
|
||||
|
||||
//#define MDTV_DEB_HASL
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Standard_GUID& TNaming_NamedShape::GetID()
|
||||
{
|
||||
static Standard_GUID TNaming_NamedShapeID("c4ef4200-568f-11d1-8940-080009dc3333");
|
||||
|
172
src/TNaming/TNaming_NamedShape.hxx
Normal file
172
src/TNaming/TNaming_NamedShape.hxx
Normal file
@@ -0,0 +1,172 @@
|
||||
// Created on: 1997-02-04
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_NamedShape_HeaderFile
|
||||
#define _TNaming_NamedShape_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TNaming_PtrNode.hxx>
|
||||
#include <TNaming_Evolution.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
class TNaming_Builder;
|
||||
class TNaming_Iterator;
|
||||
class TNaming_NewShapeIterator;
|
||||
class TNaming_OldShapeIterator;
|
||||
class Standard_GUID;
|
||||
class TopoDS_Shape;
|
||||
class TDF_Attribute;
|
||||
class TDF_DeltaOnModification;
|
||||
class TDF_DeltaOnRemoval;
|
||||
class TDF_RelocationTable;
|
||||
class TDF_DataSet;
|
||||
class TDF_AttributeDelta;
|
||||
|
||||
|
||||
class TNaming_NamedShape;
|
||||
DEFINE_STANDARD_HANDLE(TNaming_NamedShape, TDF_Attribute)
|
||||
|
||||
//! The basis to define an attribute for the storage of
|
||||
//! topology and naming data.
|
||||
//! This attribute contains two parts:
|
||||
//! - The type of evolution, a term of the
|
||||
//! enumeration TNaming_Evolution
|
||||
//! - A list of pairs of shapes called the "old"
|
||||
//! shape and the "new" shape. The meaning
|
||||
//! depends on the type of evolution.
|
||||
class TNaming_NamedShape : public TDF_Attribute
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! class method
|
||||
//! ============
|
||||
//! Returns the GUID for named shapes.
|
||||
Standard_EXPORT static const Standard_GUID& GetID();
|
||||
|
||||
Standard_EXPORT TNaming_NamedShape();
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsEmpty() const;
|
||||
|
||||
//! Returns the shapes contained in <NS>. Returns a null
|
||||
//! shape if IsEmpty.
|
||||
Standard_EXPORT TopoDS_Shape Get() const;
|
||||
|
||||
//! Returns the Evolution of the attribute.
|
||||
TNaming_Evolution Evolution() const;
|
||||
|
||||
//! Returns the Version of the attribute.
|
||||
Standard_Integer Version() const;
|
||||
|
||||
//! Set the Version of the attribute.
|
||||
void SetVersion (const Standard_Integer version);
|
||||
|
||||
Standard_EXPORT void Clear();
|
||||
~TNaming_NamedShape()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
//! Returns the ID of the attribute.
|
||||
const Standard_GUID& ID() const Standard_OVERRIDE;
|
||||
|
||||
//! Copies the attribute contents into a new other
|
||||
//! attribute. It is used by Backup().
|
||||
Standard_EXPORT virtual Handle(TDF_Attribute) BackupCopy() const Standard_OVERRIDE;
|
||||
|
||||
//! Restores the contents from <anAttribute> into this
|
||||
//! one. It is used when aborting a transaction.
|
||||
Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& anAttribute) Standard_OVERRIDE;
|
||||
|
||||
//! Makes a DeltaOnModification between <me> and
|
||||
//! <anOldAttribute.
|
||||
Standard_EXPORT virtual Handle(TDF_DeltaOnModification) DeltaOnModification (const Handle(TDF_Attribute)& anOldAttribute) const Standard_OVERRIDE;
|
||||
|
||||
//! Applies a DeltaOnModification to <me>.
|
||||
Standard_EXPORT virtual void DeltaOnModification (const Handle(TDF_DeltaOnModification)& aDelta) Standard_OVERRIDE;
|
||||
|
||||
//! Makes a DeltaOnRemoval on <me> because <me> has
|
||||
//! disappeared from the DS.
|
||||
Standard_EXPORT virtual Handle(TDF_DeltaOnRemoval) DeltaOnRemoval() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns an new empty attribute from the good end
|
||||
//! type. It is used by the copy algorithm.
|
||||
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
|
||||
|
||||
//! This method is different from the "Copy" one,
|
||||
//! because it is used when copying an attribute from
|
||||
//! a source structure into a target structure. This
|
||||
//! method pastes the current attribute to the label
|
||||
//! corresponding to the insertor. The pasted
|
||||
//! attribute may be a brand new one or a new version
|
||||
//! of the previous one.
|
||||
Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& intoAttribute, const Handle(TDF_RelocationTable)& aRelocTationable) const Standard_OVERRIDE;
|
||||
|
||||
//! Adds the directly referenced attributes and labels
|
||||
//! to <aDataSet>. "Directly" means we have only to
|
||||
//! look at the first level of references.
|
||||
Standard_EXPORT virtual void References (const Handle(TDF_DataSet)& aDataSet) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void BeforeRemoval() Standard_OVERRIDE;
|
||||
|
||||
//! Something to do before applying <anAttDelta>
|
||||
Standard_EXPORT virtual Standard_Boolean BeforeUndo (const Handle(TDF_AttributeDelta)& anAttDelta, const Standard_Boolean forceIt = Standard_False) Standard_OVERRIDE;
|
||||
|
||||
//! Something to do after applying <anAttDelta>.
|
||||
Standard_EXPORT virtual Standard_Boolean AfterUndo (const Handle(TDF_AttributeDelta)& anAttDelta, const Standard_Boolean forceIt = Standard_False) Standard_OVERRIDE;
|
||||
|
||||
//! Dumps the attribute on <aStream>.
|
||||
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
|
||||
|
||||
friend class TNaming_Builder;
|
||||
friend class TNaming_Iterator;
|
||||
friend class TNaming_NewShapeIterator;
|
||||
friend class TNaming_OldShapeIterator;
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TNaming_NamedShape,TDF_Attribute)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Adds an evolution
|
||||
Standard_EXPORT void Add (TNaming_PtrNode& Evolution);
|
||||
|
||||
TNaming_PtrNode myNode;
|
||||
TNaming_Evolution myEvolution;
|
||||
Standard_Integer myVersion;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <TNaming_NamedShape.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_NamedShape_HeaderFile
|
@@ -1,139 +0,0 @@
|
||||
-- Created on: 1997-09-08
|
||||
-- Created by: Yves FRICAUD
|
||||
-- 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.
|
||||
|
||||
class Naming from TNaming inherits Attribute from TDF
|
||||
|
||||
|
||||
---Purpose: This attribute store the topological naming of any
|
||||
-- selected shape, when this shape is not already
|
||||
-- attached to a specific label. This class is also used
|
||||
-- to solve it when the argumentsof the toipological
|
||||
-- naming are modified.
|
||||
|
||||
|
||||
|
||||
uses
|
||||
|
||||
Attribute from TDF,
|
||||
Label from TDF,
|
||||
LabelMap from TDF,
|
||||
RelocationTable from TDF,
|
||||
GUID from Standard,
|
||||
NamedShape from TNaming,
|
||||
Name from TNaming,
|
||||
Shape from TopoDS,
|
||||
AttributeIndexedMap from TDF,
|
||||
IDFilter from TDF,
|
||||
DataSet from TDF,
|
||||
Scope from TNaming
|
||||
|
||||
is
|
||||
|
||||
|
||||
|
||||
---Purpose: following code from TDesignStd
|
||||
-- ==============================
|
||||
|
||||
|
||||
GetID (myclass)
|
||||
---C++: return const &
|
||||
returns GUID from Standard;
|
||||
|
||||
Insert (myclass; under : Label from TDF)
|
||||
returns Naming from TNaming;
|
||||
|
||||
Name (myclass; where : Label from TDF;
|
||||
Selection : Shape from TopoDS;
|
||||
Context : Shape from TopoDS;
|
||||
Geometry : Boolean from Standard = Standard_False;
|
||||
KeepOrientation : Boolean from Standard = Standard_False;
|
||||
BNproblem : Boolean from Standard = Standard_False)
|
||||
returns NamedShape from TNaming;
|
||||
---Purpose: Creates a Namimg attribute at label <where> to
|
||||
-- identify the shape <Selection>. Geometry is
|
||||
-- Standard_True if we are only interested by the
|
||||
-- underlying geometry (e.g. setting a
|
||||
-- constraint). <Context> is used to find neighbours of
|
||||
-- <S> when required by the naming.
|
||||
-- If KeepOrientation is True the Selection orientation is taken
|
||||
-- into account. BNproblem == True points out that Context sub-shapes
|
||||
-- in DF have orientation differences with Context shape itself.
|
||||
|
||||
|
||||
---Purpose: instance method
|
||||
-- ===============
|
||||
|
||||
|
||||
Create
|
||||
returns Naming from TNaming;
|
||||
|
||||
IsDefined (me) returns Boolean from Standard;
|
||||
|
||||
GetName(me)
|
||||
returns Name from TNaming;
|
||||
---C++: return const &
|
||||
|
||||
ChangeName(me : mutable)
|
||||
returns Name from TNaming;
|
||||
---C++: return &
|
||||
|
||||
Regenerate (me:mutable; scope : in out LabelMap from TDF)
|
||||
---Purpose: regenerate only the Name associated to me
|
||||
returns Boolean;
|
||||
|
||||
Solve (me : mutable; scope : in out LabelMap from TDF)
|
||||
---Purpose: Regenerate recursively the whole name with scope. If
|
||||
-- scope is empty it means that all the labels of the
|
||||
-- framework are valid.
|
||||
returns Boolean from Standard;
|
||||
|
||||
ID(me)
|
||||
---C++: return const &
|
||||
returns GUID from Standard
|
||||
is redefined;
|
||||
|
||||
---Purpose: Deferred methods from TDF_Attribute
|
||||
-- ===================================
|
||||
|
||||
NewEmpty (me)
|
||||
returns Attribute from TDF;
|
||||
|
||||
Restore (me: mutable; With : Attribute from TDF);
|
||||
|
||||
Paste (me; Into : Attribute from TDF;
|
||||
RT : RelocationTable from TDF);
|
||||
|
||||
References (me; aDataSet : DataSet from TDF)
|
||||
is redefined virtual;
|
||||
|
||||
Dump(me; anOS : in out OStream from Standard)
|
||||
returns OStream from Standard
|
||||
is redefined;
|
||||
---C++: return &
|
||||
|
||||
ExtendedDump(me;
|
||||
anOS : in out OStream from Standard;
|
||||
aFilter : IDFilter from TDF;
|
||||
aMap : in out AttributeIndexedMap from TDF)
|
||||
is redefined;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myName : Name from TNaming;
|
||||
|
||||
end Naming;
|
||||
|
@@ -14,50 +14,60 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_Naming.ixx>
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <NCollection_Map.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
|
||||
#include <TColStd_MapOfInteger.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDF_Data.hxx>
|
||||
#include <TDF_DataSet.hxx>
|
||||
#include <TDF_IDFilter.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_LabelList.hxx>
|
||||
#include <TDF_LabelMap.hxx>
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
#include <TDF_TagSource.hxx>
|
||||
#include <TNaming.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_ListIteratorOfListOfNamedShape.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_Scope.hxx>
|
||||
#include <TNaming_NamingTool.hxx>
|
||||
#include <TNaming_Name.hxx>
|
||||
#include <TNaming_Identifier.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_ListIteratorOfListOfNamedShape.hxx>
|
||||
#include <TNaming_Localizer.hxx>
|
||||
#include <TNaming_Name.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Naming.hxx>
|
||||
#include <TNaming_NamingTool.hxx>
|
||||
#include <TNaming_NewShapeIterator.hxx>
|
||||
#include <TNaming_OldShapeIterator.hxx>
|
||||
#include <TNaming_Scope.hxx>
|
||||
#include <TNaming_Selector.hxx>
|
||||
#include <TNaming.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDF_LabelList.hxx>
|
||||
#include <TDF_Data.hxx>
|
||||
#include <TDF_LabelMap.hxx>
|
||||
#include <TDF_TagSource.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TColStd_MapOfInteger.hxx>
|
||||
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfOrientedShape.hxx>
|
||||
#include <TopTools_HArray1OfShape.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopTools_HArray1OfShape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopTools_ListOfShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfOrientedShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
|
||||
// #include <TNaming_NCollections.hxx>
|
||||
#include <NCollection_Map.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
typedef NCollection_Map<TopoDS_Shape> TNaming_MapOfShape;
|
||||
typedef TNaming_MapOfShape::Iterator TNaming_MapIteratorOfMapOfShape;
|
||||
typedef NCollection_DataMap<TopoDS_Shape, TNaming_MapOfShape> TNaming_DataMapOfShapeMapOfShape;
|
||||
|
129
src/TNaming/TNaming_Naming.hxx
Normal file
129
src/TNaming/TNaming_Naming.hxx
Normal file
@@ -0,0 +1,129 @@
|
||||
// Created on: 1997-09-08
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_Naming_HeaderFile
|
||||
#define _TNaming_Naming_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TNaming_Name.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TDF_LabelMap.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <TDF_AttributeIndexedMap.hxx>
|
||||
class Standard_GUID;
|
||||
class TDF_Label;
|
||||
class TNaming_NamedShape;
|
||||
class TopoDS_Shape;
|
||||
class TNaming_Name;
|
||||
class TDF_Attribute;
|
||||
class TDF_RelocationTable;
|
||||
class TDF_DataSet;
|
||||
class TDF_IDFilter;
|
||||
|
||||
|
||||
class TNaming_Naming;
|
||||
DEFINE_STANDARD_HANDLE(TNaming_Naming, TDF_Attribute)
|
||||
|
||||
//! This attribute store the topological naming of any
|
||||
//! selected shape, when this shape is not already
|
||||
//! attached to a specific label. This class is also used
|
||||
//! to solve it when the argumentsof the toipological
|
||||
//! naming are modified.
|
||||
class TNaming_Naming : public TDF_Attribute
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! following code from TDesignStd
|
||||
//! ==============================
|
||||
Standard_EXPORT static const Standard_GUID& GetID();
|
||||
|
||||
Standard_EXPORT static Handle(TNaming_Naming) Insert (const TDF_Label& under);
|
||||
|
||||
//! Creates a Namimg attribute at label <where> to
|
||||
//! identify the shape <Selection>. Geometry is
|
||||
//! Standard_True if we are only interested by the
|
||||
//! underlying geometry (e.g. setting a
|
||||
//! constraint). <Context> is used to find neighbours of
|
||||
//! <S> when required by the naming.
|
||||
//! If KeepOrientation is True the Selection orientation is taken
|
||||
//! into account. BNproblem == True points out that Context sub-shapes
|
||||
//! in DF have orientation differences with Context shape itself.
|
||||
//! instance method
|
||||
//! ===============
|
||||
Standard_EXPORT static Handle(TNaming_NamedShape) Name (const TDF_Label& where, const TopoDS_Shape& Selection, const TopoDS_Shape& Context, const Standard_Boolean Geometry = Standard_False, const Standard_Boolean KeepOrientation = Standard_False, const Standard_Boolean BNproblem = Standard_False);
|
||||
|
||||
Standard_EXPORT TNaming_Naming();
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDefined() const;
|
||||
|
||||
Standard_EXPORT const TNaming_Name& GetName() const;
|
||||
|
||||
Standard_EXPORT TNaming_Name& ChangeName();
|
||||
|
||||
//! regenerate only the Name associated to me
|
||||
Standard_EXPORT Standard_Boolean Regenerate (TDF_LabelMap& scope);
|
||||
|
||||
//! Regenerate recursively the whole name with scope. If
|
||||
//! scope is empty it means that all the labels of the
|
||||
//! framework are valid.
|
||||
Standard_EXPORT Standard_Boolean Solve (TDF_LabelMap& scope);
|
||||
|
||||
//! Deferred methods from TDF_Attribute
|
||||
//! ===================================
|
||||
Standard_EXPORT virtual const Standard_GUID& ID() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const;
|
||||
|
||||
Standard_EXPORT void Restore (const Handle(TDF_Attribute)& With);
|
||||
|
||||
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Into, const Handle(TDF_RelocationTable)& RT) const;
|
||||
|
||||
Standard_EXPORT virtual void References (const Handle(TDF_DataSet)& aDataSet) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void ExtendedDump (Standard_OStream& anOS, const TDF_IDFilter& aFilter, TDF_AttributeIndexedMap& aMap) const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TNaming_Naming,TDF_Attribute)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
TNaming_Name myName;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_Naming_HeaderFile
|
@@ -1,53 +0,0 @@
|
||||
-- Created on: 2000-02-14
|
||||
-- Created by: Denis PASCAL
|
||||
-- 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.
|
||||
|
||||
private class NamingTool from TNaming
|
||||
|
||||
---Purpose:
|
||||
|
||||
|
||||
uses Label from TDF,
|
||||
LabelMap from TDF,
|
||||
NamedShape from TNaming,
|
||||
IndexedMapOfShape from TopTools,
|
||||
Shape from TopoDS
|
||||
|
||||
|
||||
is
|
||||
|
||||
|
||||
CurrentShape (myclass;
|
||||
Valid : LabelMap from TDF;
|
||||
Forbiden : LabelMap from TDF;
|
||||
NS : NamedShape from TNaming;
|
||||
MS : in out IndexedMapOfShape from TopTools);
|
||||
|
||||
CurrentShapeFromShape (myclass;
|
||||
Valid : LabelMap from TDF;
|
||||
Forbiden : LabelMap from TDF;
|
||||
Acces : Label from TDF;
|
||||
S : Shape from TopoDS;
|
||||
MS : in out IndexedMapOfShape from TopTools);
|
||||
|
||||
BuildDescendants (myclass;
|
||||
NS : NamedShape from TNaming;
|
||||
Labels : in out LabelMap from TDF);
|
||||
|
||||
|
||||
|
||||
end NamingTool from TNaming;
|
||||
|
||||
|
||||
|
@@ -13,14 +13,17 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_NamingTool.ixx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_NewShapeIterator.hxx>
|
||||
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Naming.hxx>
|
||||
#include <TNaming_NamingTool.hxx>
|
||||
#include <TNaming_NewShapeIterator.hxx>
|
||||
#include <TNaming_OldShapeIterator.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_Naming.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#ifdef OCCT_DEBUG_DESC
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
67
src/TNaming/TNaming_NamingTool.hxx
Normal file
67
src/TNaming/TNaming_NamingTool.hxx
Normal file
@@ -0,0 +1,67 @@
|
||||
// Created on: 2000-02-14
|
||||
// Created by: Denis PASCAL
|
||||
// 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 _TNaming_NamingTool_HeaderFile
|
||||
#define _TNaming_NamingTool_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TDF_LabelMap.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
class TNaming_NamedShape;
|
||||
class TDF_Label;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
|
||||
class TNaming_NamingTool
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT static void CurrentShape (const TDF_LabelMap& Valid, const TDF_LabelMap& Forbiden, const Handle(TNaming_NamedShape)& NS, TopTools_IndexedMapOfShape& MS);
|
||||
|
||||
Standard_EXPORT static void CurrentShapeFromShape (const TDF_LabelMap& Valid, const TDF_LabelMap& Forbiden, const TDF_Label& Acces, const TopoDS_Shape& S, TopTools_IndexedMapOfShape& MS);
|
||||
|
||||
Standard_EXPORT static void BuildDescendants (const Handle(TNaming_NamedShape)& NS, TDF_LabelMap& Labels);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_NamingTool_HeaderFile
|
@@ -1,102 +0,0 @@
|
||||
-- Created on: 1996-12-17
|
||||
-- Created by: Remi Lequette
|
||||
-- Copyright (c) 1996-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.
|
||||
|
||||
class NewShapeIterator from TNaming
|
||||
|
||||
---Purpose: Iterates on all the descendants of a shape
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
UsedShapes from TNaming,
|
||||
NamedShape from TNaming,
|
||||
Iterator from TNaming,
|
||||
Label from TDF,
|
||||
PtrNode from TNaming
|
||||
|
||||
raises
|
||||
NoMoreObject from Standard,
|
||||
NoSuchObject from Standard
|
||||
|
||||
is
|
||||
|
||||
Create (aShape : Shape from TopoDS;
|
||||
Transaction : Integer from Standard;
|
||||
Shapes : UsedShapes from TNaming)
|
||||
returns NewShapeIterator from TNaming
|
||||
is private;
|
||||
|
||||
Create (aShape : Shape from TopoDS;
|
||||
Shapes : UsedShapes from TNaming)
|
||||
returns NewShapeIterator from TNaming
|
||||
is private;
|
||||
|
||||
Create (aShape : Shape from TopoDS;
|
||||
Transaction : Integer from Standard;
|
||||
access : Label from TDF)
|
||||
returns NewShapeIterator from TNaming;
|
||||
|
||||
Create (aShape : Shape from TopoDS;
|
||||
access : Label from TDF)
|
||||
returns NewShapeIterator from TNaming;
|
||||
|
||||
Create (anIterator : NewShapeIterator from TNaming)
|
||||
returns NewShapeIterator from TNaming;
|
||||
---Purpose: Iterates from the current Shape in <anIterator>
|
||||
|
||||
Create (anIterator : Iterator from TNaming)
|
||||
returns NewShapeIterator from TNaming;
|
||||
---Purpose: Iterates from the current Shape in <anIterator>
|
||||
|
||||
More(me) returns Boolean;
|
||||
---C++: inline
|
||||
|
||||
Next(me : in out)
|
||||
raises
|
||||
NoMoreObject from Standard;
|
||||
|
||||
Label(me) returns Label from TDF
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
NamedShape(me) returns NamedShape from TNaming
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
Shape(me) returns Shape from TopoDS
|
||||
---C++: return const&
|
||||
---Purpose: Warning! Can be a Null Shape if a descendant is deleted.
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
IsModification(me) returns Boolean;
|
||||
---Purpose: True if the new shape is a modification (split,
|
||||
-- fuse,etc...) of the old shape.
|
||||
|
||||
fields
|
||||
|
||||
myNode : PtrNode from TNaming;
|
||||
myTrans : Integer from Standard; -- is < 0 means in Current Transaction.
|
||||
|
||||
friends
|
||||
|
||||
class Tool from TNaming,
|
||||
class Name from TNaming,
|
||||
class Naming from TNaming
|
||||
|
||||
end NewShapeIterator;
|
||||
|
||||
|
||||
|
@@ -14,5 +14,17 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_NewShapeIterator.ixx>
|
||||
|
||||
#include <Standard_NoMoreObject.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_Name.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Naming.hxx>
|
||||
#include <TNaming_NewShapeIterator.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_UsedShapes.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
// See methods'body in TNaming_NamedShape.cxx
|
||||
|
105
src/TNaming/TNaming_NewShapeIterator.hxx
Normal file
105
src/TNaming/TNaming_NewShapeIterator.hxx
Normal file
@@ -0,0 +1,105 @@
|
||||
// Created on: 1996-12-17
|
||||
// Created by: Remi Lequette
|
||||
// Copyright (c) 1996-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 _TNaming_NewShapeIterator_HeaderFile
|
||||
#define _TNaming_NewShapeIterator_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TNaming_PtrNode.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_NoMoreObject;
|
||||
class Standard_NoSuchObject;
|
||||
class TNaming_Tool;
|
||||
class TNaming_Name;
|
||||
class TNaming_Naming;
|
||||
class TopoDS_Shape;
|
||||
class TNaming_UsedShapes;
|
||||
class TDF_Label;
|
||||
class TNaming_Iterator;
|
||||
class TNaming_NamedShape;
|
||||
|
||||
|
||||
//! Iterates on all the descendants of a shape
|
||||
class TNaming_NewShapeIterator
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT TNaming_NewShapeIterator(const TopoDS_Shape& aShape, const Standard_Integer Transaction, const TDF_Label& access);
|
||||
|
||||
Standard_EXPORT TNaming_NewShapeIterator(const TopoDS_Shape& aShape, const TDF_Label& access);
|
||||
|
||||
//! Iterates from the current Shape in <anIterator>
|
||||
Standard_EXPORT TNaming_NewShapeIterator(const TNaming_NewShapeIterator& anIterator);
|
||||
|
||||
//! Iterates from the current Shape in <anIterator>
|
||||
Standard_EXPORT TNaming_NewShapeIterator(const TNaming_Iterator& anIterator);
|
||||
|
||||
Standard_Boolean More() const;
|
||||
|
||||
Standard_EXPORT void Next();
|
||||
|
||||
Standard_EXPORT TDF_Label Label() const;
|
||||
|
||||
Standard_EXPORT Handle(TNaming_NamedShape) NamedShape() const;
|
||||
|
||||
//! Warning! Can be a Null Shape if a descendant is deleted.
|
||||
Standard_EXPORT const TopoDS_Shape& Shape() const;
|
||||
|
||||
//! True if the new shape is a modification (split,
|
||||
//! fuse,etc...) of the old shape.
|
||||
Standard_EXPORT Standard_Boolean IsModification() const;
|
||||
|
||||
|
||||
friend class TNaming_Tool;
|
||||
friend class TNaming_Name;
|
||||
friend class TNaming_Naming;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT TNaming_NewShapeIterator(const TopoDS_Shape& aShape, const Standard_Integer Transaction, const Handle(TNaming_UsedShapes)& Shapes);
|
||||
|
||||
Standard_EXPORT TNaming_NewShapeIterator(const TopoDS_Shape& aShape, const Handle(TNaming_UsedShapes)& Shapes);
|
||||
|
||||
|
||||
TNaming_PtrNode myNode;
|
||||
Standard_Integer myTrans;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <TNaming_NewShapeIterator.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_NewShapeIterator_HeaderFile
|
@@ -1,105 +0,0 @@
|
||||
-- Created on: 1996-12-16
|
||||
-- Created by: Yves FRICAUD
|
||||
-- Copyright (c) 1996-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.
|
||||
|
||||
class OldShapeIterator from TNaming
|
||||
|
||||
---Purpose: Iterates on all the ascendants of a shape
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
NamedShape from TNaming,
|
||||
UsedShapes from TNaming,
|
||||
Iterator from TNaming,
|
||||
Label from TDF,
|
||||
PtrNode from TNaming
|
||||
|
||||
raises
|
||||
NoMoreObject from Standard,
|
||||
NoSuchObject from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(aShape : Shape from TopoDS;
|
||||
Transaction : Integer from Standard;
|
||||
Shapes : UsedShapes from TNaming)
|
||||
returns OldShapeIterator from TNaming
|
||||
is private;
|
||||
|
||||
Create(aShape : Shape from TopoDS;
|
||||
Shapes : UsedShapes from TNaming)
|
||||
returns OldShapeIterator from TNaming
|
||||
is private;
|
||||
|
||||
Create(aShape : Shape from TopoDS;
|
||||
Transaction : Integer from Standard;
|
||||
access : Label from TDF)
|
||||
returns OldShapeIterator from TNaming;
|
||||
|
||||
Create(aShape : Shape from TopoDS;
|
||||
access : Label from TDF)
|
||||
returns OldShapeIterator from TNaming;
|
||||
|
||||
|
||||
Create(anIterator : OldShapeIterator from TNaming)
|
||||
returns OldShapeIterator from TNaming;
|
||||
---Purpose: Iterates from the current Shape in <anIterator>
|
||||
|
||||
Create(anIterator : Iterator from TNaming)
|
||||
returns OldShapeIterator from TNaming;
|
||||
---Purpose: Iterates from the current Shape in <anIterator>
|
||||
|
||||
More(me) returns Boolean;
|
||||
---C++: inline
|
||||
|
||||
Next(me : in out)
|
||||
raises
|
||||
NoMoreObject from Standard;
|
||||
|
||||
Label(me) returns Label from TDF
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
NamedShape(me) returns NamedShape from TNaming
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
|
||||
Shape(me) returns Shape from TopoDS
|
||||
---C++: return const&
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
IsModification(me) returns Boolean;
|
||||
---Purpose: True if the new shape is a modification (split,
|
||||
-- fuse,etc...) of the old shape.
|
||||
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myNode : PtrNode from TNaming;
|
||||
myTrans : Integer from Standard; -- is < 0 means in Current Transaction.
|
||||
|
||||
friends
|
||||
|
||||
class Tool from TNaming,
|
||||
class Localizer from TNaming,
|
||||
class Naming from TNaming
|
||||
|
||||
end OldShapeIterator;
|
||||
|
||||
|
||||
|
@@ -14,6 +14,17 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_OldShapeIterator.ixx>
|
||||
|
||||
#include <Standard_NoMoreObject.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_Localizer.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Naming.hxx>
|
||||
#include <TNaming_OldShapeIterator.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_UsedShapes.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
// See methods'body in TNaming_NamedShape.cxx
|
||||
|
104
src/TNaming/TNaming_OldShapeIterator.hxx
Normal file
104
src/TNaming/TNaming_OldShapeIterator.hxx
Normal file
@@ -0,0 +1,104 @@
|
||||
// Created on: 1996-12-16
|
||||
// Created by: Yves FRICAUD
|
||||
// Copyright (c) 1996-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 _TNaming_OldShapeIterator_HeaderFile
|
||||
#define _TNaming_OldShapeIterator_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TNaming_PtrNode.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_NoMoreObject;
|
||||
class Standard_NoSuchObject;
|
||||
class TNaming_Tool;
|
||||
class TNaming_Localizer;
|
||||
class TNaming_Naming;
|
||||
class TopoDS_Shape;
|
||||
class TNaming_UsedShapes;
|
||||
class TDF_Label;
|
||||
class TNaming_Iterator;
|
||||
class TNaming_NamedShape;
|
||||
|
||||
|
||||
//! Iterates on all the ascendants of a shape
|
||||
class TNaming_OldShapeIterator
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT TNaming_OldShapeIterator(const TopoDS_Shape& aShape, const Standard_Integer Transaction, const TDF_Label& access);
|
||||
|
||||
Standard_EXPORT TNaming_OldShapeIterator(const TopoDS_Shape& aShape, const TDF_Label& access);
|
||||
|
||||
//! Iterates from the current Shape in <anIterator>
|
||||
Standard_EXPORT TNaming_OldShapeIterator(const TNaming_OldShapeIterator& anIterator);
|
||||
|
||||
//! Iterates from the current Shape in <anIterator>
|
||||
Standard_EXPORT TNaming_OldShapeIterator(const TNaming_Iterator& anIterator);
|
||||
|
||||
Standard_Boolean More() const;
|
||||
|
||||
Standard_EXPORT void Next();
|
||||
|
||||
Standard_EXPORT TDF_Label Label() const;
|
||||
|
||||
Standard_EXPORT Handle(TNaming_NamedShape) NamedShape() const;
|
||||
|
||||
Standard_EXPORT const TopoDS_Shape& Shape() const;
|
||||
|
||||
//! True if the new shape is a modification (split,
|
||||
//! fuse,etc...) of the old shape.
|
||||
Standard_EXPORT Standard_Boolean IsModification() const;
|
||||
|
||||
|
||||
friend class TNaming_Tool;
|
||||
friend class TNaming_Localizer;
|
||||
friend class TNaming_Naming;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT TNaming_OldShapeIterator(const TopoDS_Shape& aShape, const Standard_Integer Transaction, const Handle(TNaming_UsedShapes)& Shapes);
|
||||
|
||||
Standard_EXPORT TNaming_OldShapeIterator(const TopoDS_Shape& aShape, const Handle(TNaming_UsedShapes)& Shapes);
|
||||
|
||||
|
||||
TNaming_PtrNode myNode;
|
||||
Standard_Integer myTrans;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <TNaming_OldShapeIterator.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_OldShapeIterator_HeaderFile
|
23
src/TNaming/TNaming_PtrAttribute.hxx
Normal file
23
src/TNaming/TNaming_PtrAttribute.hxx
Normal file
@@ -0,0 +1,23 @@
|
||||
// Created on: 1997-03-17
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_PtrAttribute_HeaderFile
|
||||
#define _TNaming_PtrAttribute_HeaderFile
|
||||
|
||||
class TNaming_NamedShape;
|
||||
typedef TNaming_NamedShape* TNaming_PtrAttribute;
|
||||
|
||||
#endif // _TNaming_PtrAttribute_HeaderFile
|
23
src/TNaming/TNaming_PtrNode.hxx
Normal file
23
src/TNaming/TNaming_PtrNode.hxx
Normal file
@@ -0,0 +1,23 @@
|
||||
// Created on: 1997-03-17
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_PtrNode_HeaderFile
|
||||
#define _TNaming_PtrNode_HeaderFile
|
||||
|
||||
class TNaming_Node;
|
||||
typedef TNaming_Node* TNaming_PtrNode;
|
||||
|
||||
#endif // _TNaming_PtrNode_HeaderFile
|
23
src/TNaming/TNaming_PtrRefShape.hxx
Normal file
23
src/TNaming/TNaming_PtrRefShape.hxx
Normal file
@@ -0,0 +1,23 @@
|
||||
// Created on: 1997-03-17
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_PtrRefShape_HeaderFile
|
||||
#define _TNaming_PtrRefShape_HeaderFile
|
||||
|
||||
class TNaming_RefShape;
|
||||
typedef TNaming_RefShape* TNaming_PtrRefShape;
|
||||
|
||||
#endif // _TNaming_PtrRefShape_HeaderFile
|
@@ -1,57 +0,0 @@
|
||||
-- Created on: 1996-12-17
|
||||
-- Created by: Yves FRICAUD
|
||||
-- Copyright (c) 1996-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.
|
||||
|
||||
private class RefShape from TNaming
|
||||
|
||||
uses
|
||||
Label from TDF,
|
||||
NamedShape from TNaming,
|
||||
Shape from TopoDS,
|
||||
PtrNode from TNaming
|
||||
|
||||
is
|
||||
Create returns RefShape from TNaming;
|
||||
---C++: inline
|
||||
|
||||
Create (S : Shape from TopoDS) returns RefShape from TNaming;
|
||||
---C++: inline
|
||||
|
||||
Shape (me : in out; S : Shape from TopoDS);
|
||||
---C++: inline
|
||||
|
||||
FirstUse (me : in out; aPtr : PtrNode from TNaming);
|
||||
---C++: inline
|
||||
|
||||
---Category: Querying
|
||||
|
||||
FirstUse (me) returns PtrNode from TNaming;
|
||||
---C++: inline
|
||||
|
||||
Shape (me) returns Shape from TopoDS;
|
||||
---C++: return const&
|
||||
---C++: inline
|
||||
|
||||
Label (me) returns Label from TDF;
|
||||
|
||||
NamedShape (me) returns NamedShape from TNaming;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myShape : Shape from TopoDS;
|
||||
myFirstUse : PtrNode from TNaming;
|
||||
|
||||
end RefShape;
|
@@ -14,5 +14,10 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_RefShape.ixx>
|
||||
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_RefShape.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
// See methods'body in TNaming_NamedShape.cxx
|
||||
|
81
src/TNaming/TNaming_RefShape.hxx
Normal file
81
src/TNaming/TNaming_RefShape.hxx
Normal file
@@ -0,0 +1,81 @@
|
||||
// Created on: 1996-12-17
|
||||
// Created by: Yves FRICAUD
|
||||
// Copyright (c) 1996-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 _TNaming_RefShape_HeaderFile
|
||||
#define _TNaming_RefShape_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TNaming_PtrNode.hxx>
|
||||
class TopoDS_Shape;
|
||||
class TDF_Label;
|
||||
class TNaming_NamedShape;
|
||||
|
||||
|
||||
|
||||
class TNaming_RefShape
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
TNaming_RefShape();
|
||||
|
||||
TNaming_RefShape(const TopoDS_Shape& S);
|
||||
|
||||
void Shape (const TopoDS_Shape& S);
|
||||
|
||||
void FirstUse (const TNaming_PtrNode& aPtr);
|
||||
|
||||
TNaming_PtrNode FirstUse() const;
|
||||
|
||||
const TopoDS_Shape& Shape() const;
|
||||
|
||||
Standard_EXPORT TDF_Label Label() const;
|
||||
|
||||
Standard_EXPORT Handle(TNaming_NamedShape) NamedShape() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
TopoDS_Shape myShape;
|
||||
TNaming_PtrNode myFirstUse;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <TNaming_RefShape.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_RefShape_HeaderFile
|
@@ -1,63 +0,0 @@
|
||||
-- Created on: 1997-04-24
|
||||
-- Created by: Yves FRICAUD
|
||||
-- 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.
|
||||
|
||||
class SameShapeIterator from TNaming
|
||||
|
||||
---Purpose: To iterate on all the label which contained a
|
||||
-- given shape.
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
UsedShapes from TNaming,
|
||||
Iterator from TNaming,
|
||||
Label from TDF,
|
||||
PtrNode from TNaming
|
||||
|
||||
raises
|
||||
NoMoreObject from Standard,
|
||||
NoSuchObject from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(aShape : Shape from TopoDS;
|
||||
Shapes : UsedShapes from TNaming)
|
||||
returns SameShapeIterator from TNaming
|
||||
is private;
|
||||
|
||||
Create(aShape : Shape from TopoDS;
|
||||
access : Label from TDF)
|
||||
returns SameShapeIterator from TNaming;
|
||||
|
||||
More(me) returns Boolean;
|
||||
---C++: inline
|
||||
|
||||
Next(me : in out)
|
||||
raises
|
||||
NoMoreObject from Standard;
|
||||
|
||||
Label(me) returns Label from TDF
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
fields
|
||||
myNode : PtrNode from TNaming;
|
||||
myIsNew : Boolean from Standard;
|
||||
|
||||
friends
|
||||
|
||||
class Tool from TNaming
|
||||
|
||||
end SameShapeIterator;
|
@@ -14,6 +14,13 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_SameShapeIterator.ixx>
|
||||
|
||||
#include <Standard_NoMoreObject.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TNaming_SameShapeIterator.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_UsedShapes.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
// See methods'body in TNaming_NamedShape.cxx
|
||||
|
80
src/TNaming/TNaming_SameShapeIterator.hxx
Normal file
80
src/TNaming/TNaming_SameShapeIterator.hxx
Normal file
@@ -0,0 +1,80 @@
|
||||
// Created on: 1997-04-24
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_SameShapeIterator_HeaderFile
|
||||
#define _TNaming_SameShapeIterator_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TNaming_PtrNode.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_NoMoreObject;
|
||||
class Standard_NoSuchObject;
|
||||
class TNaming_Tool;
|
||||
class TopoDS_Shape;
|
||||
class TNaming_UsedShapes;
|
||||
class TDF_Label;
|
||||
|
||||
|
||||
//! To iterate on all the label which contained a
|
||||
//! given shape.
|
||||
class TNaming_SameShapeIterator
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT TNaming_SameShapeIterator(const TopoDS_Shape& aShape, const TDF_Label& access);
|
||||
|
||||
Standard_Boolean More() const;
|
||||
|
||||
Standard_EXPORT void Next();
|
||||
|
||||
Standard_EXPORT TDF_Label Label() const;
|
||||
|
||||
|
||||
friend class TNaming_Tool;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT TNaming_SameShapeIterator(const TopoDS_Shape& aShape, const Handle(TNaming_UsedShapes)& Shapes);
|
||||
|
||||
|
||||
TNaming_PtrNode myNode;
|
||||
Standard_Boolean myIsNew;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <TNaming_SameShapeIterator.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_SameShapeIterator_HeaderFile
|
@@ -1,83 +0,0 @@
|
||||
-- Created on: 1999-11-03
|
||||
-- Created by: Denis PASCAL
|
||||
-- Copyright (c) 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.
|
||||
|
||||
private class Scope from TNaming
|
||||
|
||||
|
||||
---Purpose: this class manage a scope of labels
|
||||
-- ===================================
|
||||
|
||||
|
||||
uses Label from TDF,
|
||||
LabelMap from TDF,
|
||||
NamedShape from TNaming,
|
||||
Shape from TopoDS
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
---Purpose: WithValid = FALSE
|
||||
returns Scope from TNaming;
|
||||
|
||||
Create (WithValid : Boolean from Standard)
|
||||
---Purpose: if <WithValid> the scope is defined by the map. If not
|
||||
-- on the whole framework.
|
||||
returns Scope from TNaming;
|
||||
|
||||
Create (valid : in out LabelMap from TDF)
|
||||
---Purpose: create a scope with a map. WithValid = TRUE.
|
||||
returns Scope from TNaming;
|
||||
|
||||
WithValid (me)
|
||||
returns Boolean from Standard;
|
||||
|
||||
WithValid (me : in out; mode : Boolean from Standard);
|
||||
|
||||
ClearValid (me : in out);
|
||||
|
||||
Valid (me : in out; L :Label from TDF);
|
||||
|
||||
ValidChildren (me : in out; L : Label from TDF;
|
||||
withroot : Boolean from Standard = Standard_True);
|
||||
|
||||
Unvalid (me : in out; L :Label from TDF);
|
||||
|
||||
UnvalidChildren (me : in out; L : Label from TDF;
|
||||
withroot : Boolean from Standard = Standard_True);
|
||||
|
||||
IsValid (me; L :Label from TDF)
|
||||
returns Boolean from Standard;
|
||||
|
||||
GetValid (me)
|
||||
---C++: return const &
|
||||
returns LabelMap from TDF;
|
||||
|
||||
ChangeValid (me : in out)
|
||||
---C++: return &
|
||||
returns LabelMap from TDF;
|
||||
|
||||
CurrentShape (me ; NS : NamedShape from TNaming)
|
||||
---Purpose: Returns the current value of <NS> according to the
|
||||
-- Valid Scope.
|
||||
returns Shape from TopoDS;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myWithValid : Boolean from Standard;
|
||||
myValid : LabelMap from TDF;
|
||||
|
||||
end Scope;
|
@@ -14,17 +14,18 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_Scope.ixx>
|
||||
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Scope.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : TNaming_Scope
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TNaming_Scope::TNaming_Scope () : myWithValid(Standard_False)
|
||||
{
|
||||
}
|
||||
|
99
src/TNaming/TNaming_Scope.hxx
Normal file
99
src/TNaming/TNaming_Scope.hxx
Normal file
@@ -0,0 +1,99 @@
|
||||
// Created on: 1999-11-03
|
||||
// Created by: Denis PASCAL
|
||||
// Copyright (c) 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 _TNaming_Scope_HeaderFile
|
||||
#define _TNaming_Scope_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TDF_LabelMap.hxx>
|
||||
class TDF_Label;
|
||||
class TopoDS_Shape;
|
||||
class TNaming_NamedShape;
|
||||
|
||||
|
||||
//! this class manage a scope of labels
|
||||
//! ===================================
|
||||
class TNaming_Scope
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! WithValid = FALSE
|
||||
Standard_EXPORT TNaming_Scope();
|
||||
|
||||
//! if <WithValid> the scope is defined by the map. If not
|
||||
//! on the whole framework.
|
||||
Standard_EXPORT TNaming_Scope(const Standard_Boolean WithValid);
|
||||
|
||||
//! create a scope with a map. WithValid = TRUE.
|
||||
Standard_EXPORT TNaming_Scope(TDF_LabelMap& valid);
|
||||
|
||||
Standard_EXPORT Standard_Boolean WithValid() const;
|
||||
|
||||
Standard_EXPORT void WithValid (const Standard_Boolean mode);
|
||||
|
||||
Standard_EXPORT void ClearValid();
|
||||
|
||||
Standard_EXPORT void Valid (const TDF_Label& L);
|
||||
|
||||
Standard_EXPORT void ValidChildren (const TDF_Label& L, const Standard_Boolean withroot = Standard_True);
|
||||
|
||||
Standard_EXPORT void Unvalid (const TDF_Label& L);
|
||||
|
||||
Standard_EXPORT void UnvalidChildren (const TDF_Label& L, const Standard_Boolean withroot = Standard_True);
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsValid (const TDF_Label& L) const;
|
||||
|
||||
Standard_EXPORT const TDF_LabelMap& GetValid() const;
|
||||
|
||||
Standard_EXPORT TDF_LabelMap& ChangeValid();
|
||||
|
||||
//! Returns the current value of <NS> according to the
|
||||
//! Valid Scope.
|
||||
Standard_EXPORT TopoDS_Shape CurrentShape (const Handle(TNaming_NamedShape)& NS) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myWithValid;
|
||||
TDF_LabelMap myValid;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_Scope_HeaderFile
|
@@ -1,141 +0,0 @@
|
||||
-- Created on: 1999-09-28
|
||||
-- Created by: Denis PASCAL
|
||||
-- Copyright (c) 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.
|
||||
|
||||
class Selector from TNaming
|
||||
|
||||
---Purpose: This class provides a single API for selection of shapes.
|
||||
-- This involves both identification and selection of
|
||||
-- shapes in the data framework.
|
||||
-- If the selected shape is modified, this selector will
|
||||
-- solve its identifications.
|
||||
-- This class is the user interface for topological
|
||||
-- naming resources.
|
||||
-- * The <IsIdentified> method returns (if exists)
|
||||
-- the NamedShape which contains a given shape. The
|
||||
-- definition of an identified shape is : a Shape
|
||||
-- handled by a NamedShape (this shape is the only
|
||||
-- one stored) , which has the TNaming_PRImITIVE evolution
|
||||
--
|
||||
-- * The <Select> method returns ALWAYS a new
|
||||
-- NamedShape at the given label, which contains the
|
||||
-- argument selected shape. When calling this
|
||||
-- method, the sub-hierarchy of <label> is first cleared,
|
||||
-- then a TNaming_NamedShape is ALWAYS created at
|
||||
-- this <label>, with the TNaming_SELECTED evolution.
|
||||
-- The <Naming attribute> is associated to the selected
|
||||
-- shape which store the arguments of the selection .
|
||||
-- If the given selected shape was already identified
|
||||
-- (method IsIdentified) , this Naming attribute
|
||||
-- contains the reference (Identity code) to the
|
||||
-- argument shape.
|
||||
--
|
||||
-- * The <Solve> method update the current value of
|
||||
-- the NamedShape, according to the <Naming> attribute.
|
||||
-- A boolean status is returned to say if the
|
||||
-- algorithm succeed or not. To read the current
|
||||
-- value of the selected Named Shape use the
|
||||
-- TNaming_Tool::GetShape method, as for any
|
||||
-- NamedShape attribute.
|
||||
|
||||
|
||||
uses Label from TDF,
|
||||
LabelMap from TDF,
|
||||
Shape from TopoDS,
|
||||
NamedShape from TNaming,
|
||||
Naming from TNaming,
|
||||
AttributeMap from TDF
|
||||
|
||||
is
|
||||
|
||||
---Purpose: To know if a shape is already identified (not selected)
|
||||
-- =======================================================
|
||||
|
||||
|
||||
IsIdentified (myclass; access : Label from TDF;
|
||||
selection : Shape from TopoDS;
|
||||
NS : in out NamedShape from TNaming;
|
||||
Geometry : Boolean = Standard_False)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- The label access defines the point of access to the data framework.
|
||||
-- selection is the shape for which we want to know
|
||||
-- whether it is identified or not.
|
||||
-- If true, NS is returned as the identity of selection.
|
||||
-- If Geometry is true, NS will be the named shape
|
||||
-- containing the first appearance of selection and
|
||||
-- not any other shape. In other words, selection
|
||||
-- must be the only shape stored in NS.
|
||||
|
||||
Create (aLabel : Label from TDF) returns Selector from TNaming;
|
||||
---Purpose: Create a selector on this label
|
||||
|
||||
---Purpose: to select a shape.
|
||||
-- ==================
|
||||
|
||||
|
||||
Select (me; Selection : Shape from TopoDS;
|
||||
Context : Shape from TopoDS;
|
||||
Geometry : Boolean = Standard_False;
|
||||
KeepOrientatation : Boolean = Standard_False)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Creates a topological naming on the label
|
||||
-- aLabel given as an argument at construction time.
|
||||
-- If successful, the shape Selection - found in the
|
||||
-- shape Context - is now identified in the named
|
||||
-- shape returned in NamedShape.
|
||||
-- If Geometry is true, NamedShape contains the
|
||||
-- first appearance of Selection.
|
||||
-- This syntax is more robust than the previous
|
||||
-- syntax for this method.
|
||||
|
||||
Select (me; Selection : Shape from TopoDS;
|
||||
Geometry : Boolean = Standard_False;
|
||||
KeepOrientatation : Boolean = Standard_False)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
-- Creates a topological naming on the label
|
||||
-- aLabel given as an argument at construction time.
|
||||
-- If successful, the shape Selection is now
|
||||
-- identified in the named shape returned in NamedShape.
|
||||
-- If Geometry is true, NamedShape contains the
|
||||
-- first appearance of Selection.
|
||||
|
||||
|
||||
|
||||
Solve (me; Valid : in out LabelMap from TDF)
|
||||
returns Boolean from Standard;
|
||||
|
||||
---Purpose:
|
||||
-- Updates the topological naming on the label
|
||||
-- aLabel given as an argument at construction time.
|
||||
-- The underlying shape returned in the method
|
||||
-- NamedShape is updated.
|
||||
-- To read this shape, use the method TNaming_Tool::GetShape
|
||||
|
||||
Arguments (me; args : in out AttributeMap from TDF);
|
||||
---Purpose: Returns the attribute list args.
|
||||
-- This list contains the named shape on which the topological naming was built.
|
||||
|
||||
NamedShape(me) returns NamedShape from TNaming;
|
||||
---Purpose: Returns the NamedShape build or under construction,
|
||||
-- which contains the topological naming..
|
||||
|
||||
fields
|
||||
|
||||
myLabel : Label from TDF;
|
||||
|
||||
end Selector;
|
@@ -14,21 +14,24 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_Selector.ixx>
|
||||
#include <TNaming.hxx>
|
||||
#include <TNaming_Naming.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_Identifier.hxx>
|
||||
#include <TNaming_NameType.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDF_Tool.hxx>
|
||||
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDF_IDFilter.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_Tool.hxx>
|
||||
#include <TNaming.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_Identifier.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_NameType.hxx>
|
||||
#include <TNaming_Naming.hxx>
|
||||
#include <TNaming_NamingTool.hxx>
|
||||
#include <TNaming_NewShapeIterator.hxx>
|
||||
|
||||
#include <TNaming_Selector.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
|
||||
//#define MDTV_DEB_SEL
|
||||
#ifdef OCCT_DEBUG_SEL
|
||||
|
152
src/TNaming/TNaming_Selector.hxx
Normal file
152
src/TNaming/TNaming_Selector.hxx
Normal file
@@ -0,0 +1,152 @@
|
||||
// Created on: 1999-09-28
|
||||
// Created by: Denis PASCAL
|
||||
// Copyright (c) 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 _TNaming_Selector_HeaderFile
|
||||
#define _TNaming_Selector_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TDF_Label.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TDF_LabelMap.hxx>
|
||||
#include <TDF_AttributeMap.hxx>
|
||||
class TDF_Label;
|
||||
class TopoDS_Shape;
|
||||
class TNaming_NamedShape;
|
||||
|
||||
|
||||
//! This class provides a single API for selection of shapes.
|
||||
//! This involves both identification and selection of
|
||||
//! shapes in the data framework.
|
||||
//! If the selected shape is modified, this selector will
|
||||
//! solve its identifications.
|
||||
//! This class is the user interface for topological
|
||||
//! naming resources.
|
||||
//! * The <IsIdentified> method returns (if exists)
|
||||
//! the NamedShape which contains a given shape. The
|
||||
//! definition of an identified shape is : a Shape
|
||||
//! handled by a NamedShape (this shape is the only
|
||||
//! one stored) , which has the TNaming_PRImITIVE evolution
|
||||
//!
|
||||
//! * The <Select> method returns ALWAYS a new
|
||||
//! NamedShape at the given label, which contains the
|
||||
//! argument selected shape. When calling this
|
||||
//! method, the sub-hierarchy of <label> is first cleared,
|
||||
//! then a TNaming_NamedShape is ALWAYS created at
|
||||
//! this <label>, with the TNaming_SELECTED evolution.
|
||||
//! The <Naming attribute> is associated to the selected
|
||||
//! shape which store the arguments of the selection .
|
||||
//! If the given selected shape was already identified
|
||||
//! (method IsIdentified) , this Naming attribute
|
||||
//! contains the reference (Identity code) to the
|
||||
//! argument shape.
|
||||
//!
|
||||
//! * The <Solve> method update the current value of
|
||||
//! the NamedShape, according to the <Naming> attribute.
|
||||
//! A boolean status is returned to say if the
|
||||
//! algorithm succeed or not. To read the current
|
||||
//! value of the selected Named Shape use the
|
||||
//! TNaming_Tool::GetShape method, as for any
|
||||
//! NamedShape attribute.
|
||||
class TNaming_Selector
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! To know if a shape is already identified (not selected)
|
||||
//! =======================================================
|
||||
//!
|
||||
//! The label access defines the point of access to the data framework.
|
||||
//! selection is the shape for which we want to know
|
||||
//! whether it is identified or not.
|
||||
//! If true, NS is returned as the identity of selection.
|
||||
//! If Geometry is true, NS will be the named shape
|
||||
//! containing the first appearance of selection and
|
||||
//! not any other shape. In other words, selection
|
||||
//! must be the only shape stored in NS.
|
||||
Standard_EXPORT static Standard_Boolean IsIdentified (const TDF_Label& access, const TopoDS_Shape& selection, Handle(TNaming_NamedShape)& NS, const Standard_Boolean Geometry = Standard_False);
|
||||
|
||||
//! Create a selector on this label
|
||||
//! to select a shape.
|
||||
//! ==================
|
||||
Standard_EXPORT TNaming_Selector(const TDF_Label& aLabel);
|
||||
|
||||
|
||||
//! Creates a topological naming on the label
|
||||
//! aLabel given as an argument at construction time.
|
||||
//! If successful, the shape Selection - found in the
|
||||
//! shape Context - is now identified in the named
|
||||
//! shape returned in NamedShape.
|
||||
//! If Geometry is true, NamedShape contains the
|
||||
//! first appearance of Selection.
|
||||
//! This syntax is more robust than the previous
|
||||
//! syntax for this method.
|
||||
Standard_EXPORT Standard_Boolean Select (const TopoDS_Shape& Selection, const TopoDS_Shape& Context, const Standard_Boolean Geometry = Standard_False, const Standard_Boolean KeepOrientatation = Standard_False) const;
|
||||
|
||||
|
||||
//! Creates a topological naming on the label
|
||||
//! aLabel given as an argument at construction time.
|
||||
//! If successful, the shape Selection is now
|
||||
//! identified in the named shape returned in NamedShape.
|
||||
//! If Geometry is true, NamedShape contains the
|
||||
//! first appearance of Selection.
|
||||
Standard_EXPORT Standard_Boolean Select (const TopoDS_Shape& Selection, const Standard_Boolean Geometry = Standard_False, const Standard_Boolean KeepOrientatation = Standard_False) const;
|
||||
|
||||
|
||||
//! Updates the topological naming on the label
|
||||
//! aLabel given as an argument at construction time.
|
||||
//! The underlying shape returned in the method
|
||||
//! NamedShape is updated.
|
||||
//! To read this shape, use the method TNaming_Tool::GetShape
|
||||
Standard_EXPORT Standard_Boolean Solve (TDF_LabelMap& Valid) const;
|
||||
|
||||
//! Returns the attribute list args.
|
||||
//! This list contains the named shape on which the topological naming was built.
|
||||
Standard_EXPORT void Arguments (TDF_AttributeMap& args) const;
|
||||
|
||||
//! Returns the NamedShape build or under construction,
|
||||
//! which contains the topological naming..
|
||||
Standard_EXPORT Handle(TNaming_NamedShape) NamedShape() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
TDF_Label myLabel;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_Selector_HeaderFile
|
@@ -1,96 +0,0 @@
|
||||
-- Created on: 1997-01-09
|
||||
-- Created by: Yves FRICAUD
|
||||
-- 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.
|
||||
|
||||
private class ShapesSet from TNaming
|
||||
|
||||
---Purpose:
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
ShapeEnum from TopAbs,
|
||||
MapOfShape from TopTools
|
||||
|
||||
is
|
||||
Create returns ShapesSet from TNaming;
|
||||
---C++: inline
|
||||
|
||||
Create (S : Shape from TopoDS;
|
||||
Type : ShapeEnum from TopAbs = TopAbs_SHAPE)
|
||||
returns ShapesSet from TNaming;
|
||||
|
||||
---Category: Modification
|
||||
|
||||
Clear(me : in out)
|
||||
---Level: Public
|
||||
---Purpose: Removes all Shapes
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
Add(me : in out; S : Shape from TopoDS) returns Boolean
|
||||
---Level: Public
|
||||
---Purpose: Adds the Shape <S>
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
Contains(me; S : Shape ) returns Boolean
|
||||
---Level: Public
|
||||
---Purpose: Returns True if <S> is in <me>
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
Remove(me : in out; S : Shape ) returns Boolean
|
||||
---Level: Public
|
||||
---Purpose: Removes <S> in <me>.
|
||||
---C++: inline
|
||||
is static;
|
||||
|
||||
|
||||
-- Modification with an other ShapesSet--
|
||||
|
||||
Add (me : in out; Shapes : ShapesSet from TNaming);
|
||||
---Purpose: Adds the shapes contained in <Shapes>.
|
||||
|
||||
Filter (me : in out; Shapes : ShapesSet from TNaming);
|
||||
---Purpose: Erases in <me> the shapes not
|
||||
-- contained in <Shapes>
|
||||
|
||||
|
||||
Remove (me : in out; Shapes : ShapesSet from TNaming);
|
||||
---Purpose: Removes in <me> the shapes contained in <Shapes>
|
||||
|
||||
|
||||
---Category: Querying
|
||||
|
||||
IsEmpty(me) returns Boolean from Standard;
|
||||
---C++: inline
|
||||
|
||||
NbShapes (me) returns Integer from Standard;
|
||||
---C++: inline
|
||||
|
||||
ChangeMap(me: in out) returns MapOfShape from TopTools;
|
||||
---C++: return &
|
||||
---C++: inline
|
||||
|
||||
Map(me) returns MapOfShape from TopTools;
|
||||
---C++: return const&
|
||||
---C++: inline
|
||||
|
||||
fields
|
||||
myMap : MapOfShape from TopTools;
|
||||
|
||||
end ShapesSet;
|
||||
|
||||
|
@@ -14,20 +14,19 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_ShapesSet.ixx>
|
||||
#include <TNaming_IteratorOnShapesSet.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_IteratorOnShapesSet.hxx>
|
||||
#include <TNaming_ShapesSet.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//#define MDTV_DEB_INT
|
||||
//=======================================================================
|
||||
//function : TNaming_ShapesSet
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TNaming_ShapesSet::TNaming_ShapesSet (const TopoDS_Shape& CS,
|
||||
const TopAbs_ShapeEnum Type)
|
||||
{
|
||||
|
98
src/TNaming/TNaming_ShapesSet.hxx
Normal file
98
src/TNaming/TNaming_ShapesSet.hxx
Normal file
@@ -0,0 +1,98 @@
|
||||
// Created on: 1997-01-09
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_ShapesSet_HeaderFile
|
||||
#define _TNaming_ShapesSet_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
|
||||
class TNaming_ShapesSet
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
TNaming_ShapesSet();
|
||||
|
||||
Standard_EXPORT TNaming_ShapesSet(const TopoDS_Shape& S, const TopAbs_ShapeEnum Type = TopAbs_SHAPE);
|
||||
|
||||
//! Removes all Shapes
|
||||
void Clear();
|
||||
|
||||
//! Adds the Shape <S>
|
||||
Standard_Boolean Add (const TopoDS_Shape& S);
|
||||
|
||||
//! Returns True if <S> is in <me>
|
||||
Standard_Boolean Contains (const TopoDS_Shape& S) const;
|
||||
|
||||
//! Removes <S> in <me>.
|
||||
Standard_Boolean Remove (const TopoDS_Shape& S);
|
||||
|
||||
//! Adds the shapes contained in <Shapes>.
|
||||
Standard_EXPORT void Add (const TNaming_ShapesSet& Shapes);
|
||||
|
||||
//! Erases in <me> the shapes not
|
||||
//! contained in <Shapes>
|
||||
Standard_EXPORT void Filter (const TNaming_ShapesSet& Shapes);
|
||||
|
||||
//! Removes in <me> the shapes contained in <Shapes>
|
||||
Standard_EXPORT void Remove (const TNaming_ShapesSet& Shapes);
|
||||
|
||||
Standard_Boolean IsEmpty() const;
|
||||
|
||||
Standard_Integer NbShapes() const;
|
||||
|
||||
TopTools_MapOfShape& ChangeMap();
|
||||
|
||||
const TopTools_MapOfShape& Map() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
TopTools_MapOfShape myMap;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <TNaming_ShapesSet.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_ShapesSet_HeaderFile
|
@@ -1,223 +0,0 @@
|
||||
-- Created on: 1996-12-24
|
||||
-- Created by: Yves FRICAUD
|
||||
-- Copyright (c) 1996-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.
|
||||
|
||||
class Tool from TNaming
|
||||
|
||||
---Purpose: A tool to get information on the topology of a
|
||||
-- named shape attribute.
|
||||
-- This information is typically a TopoDS_Shape object.
|
||||
-- Using this tool, relations between named shapes
|
||||
-- are also accessible.
|
||||
|
||||
|
||||
uses
|
||||
Label from TDF,
|
||||
LabelList from TDF,
|
||||
LabelMap from TDF,
|
||||
NamedShape from TNaming,
|
||||
UsedShapes from TNaming,
|
||||
Evolution from TNaming,
|
||||
MapOfNamedShape from TNaming,
|
||||
ListOfShape from TopTools,
|
||||
Shape from TopoDS,
|
||||
OldShapeIterator from TNaming,
|
||||
IndexedMapOfShape from TopTools
|
||||
|
||||
is
|
||||
|
||||
|
||||
CurrentShape (myclass ; NS : NamedShape from TNaming)
|
||||
---Purpose: Returns the last Modification of <NS>.
|
||||
-- Returns the shape CurrentShape contained in
|
||||
-- the named shape attribute NS.
|
||||
-- CurrentShape is the current state of the entities
|
||||
-- if they have been modified in other attributes of the same data structure.
|
||||
-- Each call to this function creates a new compound.
|
||||
returns Shape from TopoDS;
|
||||
|
||||
CurrentShape (myclass ; NS : NamedShape from TNaming;
|
||||
Updated : LabelMap from TDF)
|
||||
---Purpose: Returns the shape CurrentShape contained in
|
||||
-- the named shape attribute NS, and present in
|
||||
-- the updated attribute map Updated.
|
||||
-- CurrentShape is the current state of the entities
|
||||
-- if they have been modified in other attributes of the same data structure.
|
||||
-- Each call to this function creates a new compound.
|
||||
-- Warning
|
||||
-- Only the contents of Updated are searched.R
|
||||
returns Shape from TopoDS;
|
||||
|
||||
|
||||
|
||||
CurrentNamedShape (myclass ; NS : NamedShape from TNaming;
|
||||
Updated : LabelMap from TDF)
|
||||
---Purpose: Returns the NamedShape of the last Modification of <NS>.
|
||||
-- This shape is identified by a label.
|
||||
returns NamedShape from TNaming;
|
||||
|
||||
CurrentNamedShape (myclass ; NS : NamedShape from TNaming)
|
||||
---Purpose: Returns NamedShape the last Modification of <NS>.
|
||||
returns NamedShape from TNaming;
|
||||
|
||||
NamedShape (myclass; aShape : Shape from TopoDS;
|
||||
anAcces : Label from TDF)
|
||||
---Purpose: Returns the named shape attribute defined by
|
||||
-- the shape aShape and the label anAccess.
|
||||
-- This attribute is returned as a new shape.
|
||||
-- You call this function, if you need to create a
|
||||
-- topological attribute for existing data.
|
||||
-- Example
|
||||
-- class MyPkg_MyClass
|
||||
-- {
|
||||
-- public: Standard_Boolean
|
||||
-- SameEdge(const
|
||||
-- Handle(OCafTest_Line)& , const
|
||||
-- Handle(CafTest_Line)& );
|
||||
-- };
|
||||
--
|
||||
-- Standard_Boolean
|
||||
-- MyPkg_MyClass::SameEdge
|
||||
-- (const Handle(OCafTest_Line)& L1
|
||||
-- const Handle(OCafTest_Line)& L2)
|
||||
-- { Handle(TNaming_NamedShape)
|
||||
-- NS1 = L1->NamedShape();
|
||||
-- Handle(TNaming_NamedShape)
|
||||
-- NS2 = L2->NamedShape();
|
||||
--
|
||||
-- return
|
||||
-- BRepTools::Compare(NS1->Get(),NS2->Get());
|
||||
-- }
|
||||
-- In the example above, the function SameEdge is
|
||||
-- created to compare the edges having two lines
|
||||
-- for geometric supports. If these edges are found
|
||||
-- by BRepTools::Compare to be within the same
|
||||
-- tolerance, they are considered to be the same.
|
||||
-- Warning
|
||||
-- To avoid sharing of names, a SELECTED
|
||||
-- attribute will not be returned. Sharing of names
|
||||
-- makes it harder to manage the data structure.
|
||||
-- When the user of the name is removed, for
|
||||
-- example, it is difficult to know whether the name
|
||||
-- should be destroyed.
|
||||
returns NamedShape from TNaming;
|
||||
|
||||
|
||||
GetShape (myclass ; NS : NamedShape from TNaming)
|
||||
---Purpose: Returns the entities stored in the named shape attribute NS.
|
||||
-- If there is only one old-new pair, the new shape
|
||||
-- is returned. Otherwise, a Compound is returned.
|
||||
-- This compound is made out of all the new shapes found.
|
||||
-- Each call to this function creates a new compound.
|
||||
returns Shape from TopoDS;
|
||||
|
||||
OriginalShape (myclass ; NS : NamedShape from TNaming)
|
||||
--- Purpose: Returns the shape contained as OldShape in <NS>
|
||||
returns Shape from TopoDS;
|
||||
|
||||
GeneratedShape (myclass; S : Shape from TopoDS;
|
||||
Generation : NamedShape from TNaming)
|
||||
---Purpose: Returns the shape generated from S or by a
|
||||
-- modification of S and contained in the named
|
||||
-- shape Generation.
|
||||
returns Shape from TopoDS;
|
||||
|
||||
|
||||
Collect (myclass; NS : NamedShape from TNaming;
|
||||
Labels : out MapOfNamedShape from TNaming;
|
||||
OnlyModif : Boolean = Standard_True);
|
||||
|
||||
HasLabel(myclass; access : Label from TDF;
|
||||
aShape : Shape from TopoDS)
|
||||
---Purpose: Returns True if <aShape> appears under a label.(DP)
|
||||
returns Boolean from Standard;
|
||||
|
||||
Label (myclass; access : Label from TDF;
|
||||
aShape : Shape from TopoDS;
|
||||
TransDef : in out Integer from Standard)
|
||||
returns Label from TDF;
|
||||
---Purpose: Returns the label of the first apparition of
|
||||
-- <aShape>. Transdef is a value of the transaction
|
||||
-- of the first apparition of <aShape>.
|
||||
|
||||
InitialShape (myclass ; aShape : Shape from TopoDS ;
|
||||
anAcces : Label from TDF;
|
||||
Labels : in out LabelList from TDF)
|
||||
---Purpose:
|
||||
-- Returns the shape created from the shape
|
||||
-- aShape contained in the attribute anAcces.
|
||||
returns Shape from TopoDS;
|
||||
|
||||
|
||||
|
||||
ValidUntil (myclass; access : Label from TDF;
|
||||
S : Shape from TopoDS)
|
||||
---Purpose: Returns the last transaction where the creation of S
|
||||
-- is valid.
|
||||
returns Integer from Standard;
|
||||
|
||||
FindShape (myclass;
|
||||
Valid : LabelMap from TDF;
|
||||
Forbiden : LabelMap from TDF;
|
||||
Arg : NamedShape from TNaming;
|
||||
S : in out Shape from TopoDS);
|
||||
---Purpose: Returns the current shape (a Wire or a Shell) built (in the data framework)
|
||||
-- from the the shapes of the argument named shape.
|
||||
-- It is used for IDENTITY name type computation.
|
||||
|
||||
|
||||
|
||||
|
||||
---Category: private methods
|
||||
-- ===============
|
||||
|
||||
HasLabel(myclass; Shapes : UsedShapes from TNaming;
|
||||
aShape : Shape from TopoDS)
|
||||
---Purpose: Returns True if <aShape> appears under a label.
|
||||
returns Boolean from Standard
|
||||
is private;
|
||||
|
||||
|
||||
ValidUntil (myclass; S : Shape from TopoDS;
|
||||
US : UsedShapes from TNaming)
|
||||
---Purpose: Returns the last transaction where the creation of S
|
||||
-- is valid.
|
||||
returns Integer from Standard
|
||||
is private;
|
||||
|
||||
Label(myclass; Shapes : UsedShapes from TNaming;
|
||||
aShape : Shape from TopoDS;
|
||||
TransDef : in out Integer from Standard)
|
||||
returns Label from TDF
|
||||
is private;
|
||||
---Purpose: Returns the label of the first apparition of
|
||||
-- <aShape>. Transdef is a value of the transaction
|
||||
-- of the first apparition of <aShape>.
|
||||
|
||||
FirstOlds (myclass; Shapes : UsedShapes from TNaming;
|
||||
S : Shape from TopoDS;
|
||||
it : in out OldShapeIterator from TNaming;
|
||||
MS : in out IndexedMapOfShape from TopTools;
|
||||
Labels : in out LabelList from TDF)
|
||||
is private;
|
||||
|
||||
|
||||
friends
|
||||
|
||||
class Localizer from TNaming,
|
||||
class NamedShape from TNaming,
|
||||
class OldShapeIterator from TNaming
|
||||
|
||||
end Tool;
|
@@ -14,35 +14,37 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <TDF_AttributeMap.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TDF_Label.hxx>
|
||||
#include <TDF_LabelList.hxx>
|
||||
#include <TNaming_Tool.ixx>
|
||||
#include <TDF_MapIteratorOfAttributeMap.hxx>
|
||||
#include <TDF_Tool.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_ListIteratorOfListOfNamedShape.hxx>
|
||||
#include <TNaming_ListOfNamedShape.hxx>
|
||||
#include <TNaming_Localizer.hxx>
|
||||
#include <TNaming_NamedShape.hxx>
|
||||
#include <TNaming_Naming.hxx>
|
||||
#include <TNaming_NewShapeIterator.hxx>
|
||||
#include <TNaming_OldShapeIterator.hxx>
|
||||
#include <TNaming_Iterator.hxx>
|
||||
#include <TNaming_RefShape.hxx>
|
||||
#include <TNaming_Tool.hxx>
|
||||
#include <TNaming_UsedShapes.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
|
||||
#include <TNaming_Naming.hxx>
|
||||
#include <TNaming_ListOfNamedShape.hxx>
|
||||
#include <TDF_AttributeMap.hxx>
|
||||
#include <TDF_Tool.hxx>
|
||||
#include <TDF_MapIteratorOfAttributeMap.hxx>
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TNaming_ListIteratorOfListOfNamedShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : LastModif
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static void LastModif( TNaming_NewShapeIterator& it,
|
||||
const TopoDS_Shape& S,
|
||||
TopTools_IndexedMapOfShape& MS,
|
||||
|
194
src/TNaming/TNaming_Tool.hxx
Normal file
194
src/TNaming/TNaming_Tool.hxx
Normal file
@@ -0,0 +1,194 @@
|
||||
// Created on: 1996-12-24
|
||||
// Created by: Yves FRICAUD
|
||||
// Copyright (c) 1996-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 _TNaming_Tool_HeaderFile
|
||||
#define _TNaming_Tool_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TDF_LabelMap.hxx>
|
||||
#include <TNaming_MapOfNamedShape.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TDF_LabelList.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
class TNaming_Localizer;
|
||||
class TNaming_NamedShape;
|
||||
class TNaming_OldShapeIterator;
|
||||
class TopoDS_Shape;
|
||||
class TDF_Label;
|
||||
class TNaming_UsedShapes;
|
||||
|
||||
|
||||
//! A tool to get information on the topology of a
|
||||
//! named shape attribute.
|
||||
//! This information is typically a TopoDS_Shape object.
|
||||
//! Using this tool, relations between named shapes
|
||||
//! are also accessible.
|
||||
class TNaming_Tool
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Returns the last Modification of <NS>.
|
||||
//! Returns the shape CurrentShape contained in
|
||||
//! the named shape attribute NS.
|
||||
//! CurrentShape is the current state of the entities
|
||||
//! if they have been modified in other attributes of the same data structure.
|
||||
//! Each call to this function creates a new compound.
|
||||
Standard_EXPORT static TopoDS_Shape CurrentShape (const Handle(TNaming_NamedShape)& NS);
|
||||
|
||||
//! Returns the shape CurrentShape contained in
|
||||
//! the named shape attribute NS, and present in
|
||||
//! the updated attribute map Updated.
|
||||
//! CurrentShape is the current state of the entities
|
||||
//! if they have been modified in other attributes of the same data structure.
|
||||
//! Each call to this function creates a new compound.
|
||||
//! Warning
|
||||
//! Only the contents of Updated are searched.R
|
||||
Standard_EXPORT static TopoDS_Shape CurrentShape (const Handle(TNaming_NamedShape)& NS, const TDF_LabelMap& Updated);
|
||||
|
||||
//! Returns the NamedShape of the last Modification of <NS>.
|
||||
//! This shape is identified by a label.
|
||||
Standard_EXPORT static Handle(TNaming_NamedShape) CurrentNamedShape (const Handle(TNaming_NamedShape)& NS, const TDF_LabelMap& Updated);
|
||||
|
||||
//! Returns NamedShape the last Modification of <NS>.
|
||||
Standard_EXPORT static Handle(TNaming_NamedShape) CurrentNamedShape (const Handle(TNaming_NamedShape)& NS);
|
||||
|
||||
//! Returns the named shape attribute defined by
|
||||
//! the shape aShape and the label anAccess.
|
||||
//! This attribute is returned as a new shape.
|
||||
//! You call this function, if you need to create a
|
||||
//! topological attribute for existing data.
|
||||
//! Example
|
||||
//! class MyPkg_MyClass
|
||||
//! {
|
||||
//! public: Standard_Boolean
|
||||
//! SameEdge(const
|
||||
//! Handle(OCafTest_Line)& , const
|
||||
//! Handle(CafTest_Line)& );
|
||||
//! };
|
||||
//!
|
||||
//! Standard_Boolean
|
||||
//! MyPkg_MyClass::SameEdge
|
||||
//! (const Handle(OCafTest_Line)& L1
|
||||
//! const Handle(OCafTest_Line)& L2)
|
||||
//! { Handle(TNaming_NamedShape)
|
||||
//! NS1 = L1->NamedShape();
|
||||
//! Handle(TNaming_NamedShape)
|
||||
//! NS2 = L2->NamedShape();
|
||||
//!
|
||||
//! return
|
||||
//! BRepTools::Compare(NS1->Get(),NS2->Get());
|
||||
//! }
|
||||
//! In the example above, the function SameEdge is
|
||||
//! created to compare the edges having two lines
|
||||
//! for geometric supports. If these edges are found
|
||||
//! by BRepTools::Compare to be within the same
|
||||
//! tolerance, they are considered to be the same.
|
||||
//! Warning
|
||||
//! To avoid sharing of names, a SELECTED
|
||||
//! attribute will not be returned. Sharing of names
|
||||
//! makes it harder to manage the data structure.
|
||||
//! When the user of the name is removed, for
|
||||
//! example, it is difficult to know whether the name
|
||||
//! should be destroyed.
|
||||
Standard_EXPORT static Handle(TNaming_NamedShape) NamedShape (const TopoDS_Shape& aShape, const TDF_Label& anAcces);
|
||||
|
||||
//! Returns the entities stored in the named shape attribute NS.
|
||||
//! If there is only one old-new pair, the new shape
|
||||
//! is returned. Otherwise, a Compound is returned.
|
||||
//! This compound is made out of all the new shapes found.
|
||||
//! Each call to this function creates a new compound.
|
||||
Standard_EXPORT static TopoDS_Shape GetShape (const Handle(TNaming_NamedShape)& NS);
|
||||
|
||||
//! Returns the shape contained as OldShape in <NS>
|
||||
Standard_EXPORT static TopoDS_Shape OriginalShape (const Handle(TNaming_NamedShape)& NS);
|
||||
|
||||
//! Returns the shape generated from S or by a
|
||||
//! modification of S and contained in the named
|
||||
//! shape Generation.
|
||||
Standard_EXPORT static TopoDS_Shape GeneratedShape (const TopoDS_Shape& S, const Handle(TNaming_NamedShape)& Generation);
|
||||
|
||||
Standard_EXPORT static void Collect (const Handle(TNaming_NamedShape)& NS, TNaming_MapOfNamedShape& Labels, const Standard_Boolean OnlyModif = Standard_True);
|
||||
|
||||
//! Returns True if <aShape> appears under a label.(DP)
|
||||
Standard_EXPORT static Standard_Boolean HasLabel (const TDF_Label& access, const TopoDS_Shape& aShape);
|
||||
|
||||
//! Returns the label of the first apparition of
|
||||
//! <aShape>. Transdef is a value of the transaction
|
||||
//! of the first apparition of <aShape>.
|
||||
Standard_EXPORT static TDF_Label Label (const TDF_Label& access, const TopoDS_Shape& aShape, Standard_Integer& TransDef);
|
||||
|
||||
|
||||
//! Returns the shape created from the shape
|
||||
//! aShape contained in the attribute anAcces.
|
||||
Standard_EXPORT static TopoDS_Shape InitialShape (const TopoDS_Shape& aShape, const TDF_Label& anAcces, TDF_LabelList& Labels);
|
||||
|
||||
//! Returns the last transaction where the creation of S
|
||||
//! is valid.
|
||||
Standard_EXPORT static Standard_Integer ValidUntil (const TDF_Label& access, const TopoDS_Shape& S);
|
||||
|
||||
//! Returns the current shape (a Wire or a Shell) built (in the data framework)
|
||||
//! from the the shapes of the argument named shape.
|
||||
//! It is used for IDENTITY name type computation.
|
||||
Standard_EXPORT static void FindShape (const TDF_LabelMap& Valid, const TDF_LabelMap& Forbiden, const Handle(TNaming_NamedShape)& Arg, TopoDS_Shape& S);
|
||||
|
||||
|
||||
friend class TNaming_Localizer;
|
||||
friend class TNaming_NamedShape;
|
||||
friend class TNaming_OldShapeIterator;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Returns True if <aShape> appears under a label.
|
||||
Standard_EXPORT static Standard_Boolean HasLabel (const Handle(TNaming_UsedShapes)& Shapes, const TopoDS_Shape& aShape);
|
||||
|
||||
//! Returns the last transaction where the creation of S
|
||||
//! is valid.
|
||||
Standard_EXPORT static Standard_Integer ValidUntil (const TopoDS_Shape& S, const Handle(TNaming_UsedShapes)& US);
|
||||
|
||||
//! Returns the label of the first apparition of
|
||||
//! <aShape>. Transdef is a value of the transaction
|
||||
//! of the first apparition of <aShape>.
|
||||
Standard_EXPORT static TDF_Label Label (const Handle(TNaming_UsedShapes)& Shapes, const TopoDS_Shape& aShape, Standard_Integer& TransDef);
|
||||
|
||||
Standard_EXPORT static void FirstOlds (const Handle(TNaming_UsedShapes)& Shapes, const TopoDS_Shape& S, TNaming_OldShapeIterator& it, TopTools_IndexedMapOfShape& MS, TDF_LabelList& Labels);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_Tool_HeaderFile
|
@@ -1,124 +0,0 @@
|
||||
-- Created on: 1999-06-24
|
||||
-- Created by: Sergey ZARITCHNY
|
||||
-- Copyright (c) 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.
|
||||
|
||||
class TranslateTool from TNaming inherits TShared from MMgt
|
||||
|
||||
---Purpose: tool to copy underlying TShape of a Shape.
|
||||
-- The TranslateTool class is provided to support the
|
||||
-- translation of topological data structures Transient
|
||||
-- to Transient.
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
IndexedDataMapOfTransientTransient from TColStd
|
||||
|
||||
raises
|
||||
|
||||
TypeMismatch from Standard
|
||||
|
||||
is
|
||||
|
||||
Add(me;
|
||||
S1 : in out Shape from TopoDS;
|
||||
S2 : Shape from TopoDS)
|
||||
---Level: Internal
|
||||
raises
|
||||
TypeMismatch from Standard;
|
||||
|
||||
--
|
||||
-- The Make methods should create a new empty object of the
|
||||
-- given type with the given Model. They should raise the
|
||||
-- TypeMismatch exception if the Model is not of the
|
||||
-- expected type.
|
||||
--
|
||||
|
||||
|
||||
MakeVertex(me;
|
||||
S : out Shape from TopoDS)
|
||||
---Level: Internal
|
||||
raises
|
||||
TypeMismatch from Standard;
|
||||
|
||||
MakeEdge(me;
|
||||
S : out Shape from TopoDS)
|
||||
---Level: Internal
|
||||
raises
|
||||
TypeMismatch from Standard;
|
||||
|
||||
MakeWire(me;
|
||||
S : out Shape from TopoDS)
|
||||
---Level: Internal
|
||||
raises
|
||||
TypeMismatch from Standard;
|
||||
|
||||
MakeFace(me;
|
||||
S : out Shape from TopoDS)
|
||||
---Level: Internal
|
||||
raises
|
||||
TypeMismatch from Standard;
|
||||
|
||||
MakeShell(me;
|
||||
S : out Shape from TopoDS)
|
||||
---Level: Internal
|
||||
raises
|
||||
TypeMismatch from Standard;
|
||||
|
||||
MakeSolid(me;
|
||||
S : out Shape from TopoDS)
|
||||
---Level: Internal
|
||||
raises
|
||||
TypeMismatch from Standard;
|
||||
|
||||
MakeCompSolid(me;
|
||||
S : out Shape from TopoDS)
|
||||
---Level: Internal
|
||||
raises
|
||||
TypeMismatch from Standard;
|
||||
|
||||
MakeCompound(me;
|
||||
S : out Shape from TopoDS)
|
||||
---Level: Internal
|
||||
raises
|
||||
TypeMismatch from Standard;
|
||||
|
||||
--
|
||||
-- The Update methods should transfer the data from the first
|
||||
-- shape to the second.
|
||||
--
|
||||
|
||||
UpdateVertex(me;
|
||||
S1 : Shape from TopoDS;
|
||||
S2 : in out Shape from TopoDS;
|
||||
M : in out IndexedDataMapOfTransientTransient from TColStd);
|
||||
---Level: Internal
|
||||
|
||||
UpdateEdge (me;
|
||||
S1 : Shape from TopoDS;
|
||||
S2 : in out Shape from TopoDS;
|
||||
M : in out IndexedDataMapOfTransientTransient from TColStd);
|
||||
---Level: Internal
|
||||
|
||||
UpdateFace (me;
|
||||
S1 : Shape from TopoDS;
|
||||
S2 : in out Shape from TopoDS;
|
||||
M : in out IndexedDataMapOfTransientTransient from TColStd);
|
||||
---Level: Internal
|
||||
UpdateShape (me;
|
||||
S1 : Shape from TopoDS;
|
||||
S2 : in out Shape from TopoDS);
|
||||
---Level: Internal
|
||||
|
||||
end TranslateTool;
|
@@ -14,52 +14,51 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_TranslateTool.ixx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <BRep_TVertex.hxx>
|
||||
#include <BRep_ListIteratorOfListOfPointRepresentation.hxx>
|
||||
#include <BRep_ListOfPointRepresentation.hxx>
|
||||
#include <BRep_PointRepresentation.hxx>
|
||||
#include <BRep_PointOnCurve.hxx>
|
||||
#include <BRep_PointOnCurveOnSurface.hxx>
|
||||
#include <TNaming_CopyShape.hxx>
|
||||
#include <BRep_TFace.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_PointOnSurface.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_ListOfCurveRepresentation.hxx>
|
||||
#include <BRep_Curve3D.hxx>
|
||||
#include <BRep_CurveOn2Surfaces.hxx>
|
||||
#include <BRep_CurveOnClosedSurface.hxx>
|
||||
#include <BRep_CurveOnSurface.hxx>
|
||||
#include <BRep_CurveRepresentation.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <BRep_Curve3D.hxx>
|
||||
#include <BRep_CurveOnSurface.hxx>
|
||||
#include <BRep_CurveOnClosedSurface.hxx>
|
||||
#include <BRep_CurveOn2Surfaces.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_ListIteratorOfListOfPointRepresentation.hxx>
|
||||
#include <BRep_ListOfCurveRepresentation.hxx>
|
||||
#include <BRep_ListOfPointRepresentation.hxx>
|
||||
#include <BRep_PointOnCurve.hxx>
|
||||
#include <BRep_PointOnCurveOnSurface.hxx>
|
||||
#include <BRep_PointOnSurface.hxx>
|
||||
#include <BRep_PointRepresentation.hxx>
|
||||
#include <BRep_Polygon3D.hxx>
|
||||
#include <BRep_PolygonOnClosedSurface.hxx>
|
||||
#include <BRep_PolygonOnSurface.hxx>
|
||||
#include <BRep_PolygonOnClosedTriangulation.hxx>
|
||||
#include <BRep_PolygonOnSurface.hxx>
|
||||
#include <BRep_PolygonOnTriangulation.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_TFace.hxx>
|
||||
#include <BRep_TVertex.hxx>
|
||||
#include <Standard_NullObject.hxx>
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_TypeMismatch.hxx>
|
||||
#include <TNaming_CopyShape.hxx>
|
||||
#include <TNaming_TranslateTool.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : TNaming_TranslateTool
|
||||
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//TNaming_TranslateTool::TNaming_TranslateTool
|
||||
//(const MgtBRep_TriangleMode aTriMode) :
|
||||
//myTriangleMode(aTriMode)
|
||||
//{
|
||||
//}
|
||||
|
||||
//=======================================================================
|
||||
//function : Add
|
||||
//purpose : Adds S2 in S1
|
||||
//=======================================================================
|
||||
|
||||
void TNaming_TranslateTool::Add(TopoDS_Shape& S1,
|
||||
const TopoDS_Shape& S2) const
|
||||
{
|
||||
|
91
src/TNaming/TNaming_TranslateTool.hxx
Normal file
91
src/TNaming/TNaming_TranslateTool.hxx
Normal file
@@ -0,0 +1,91 @@
|
||||
// Created on: 1999-06-24
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 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 _TNaming_TranslateTool_HeaderFile
|
||||
#define _TNaming_TranslateTool_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
|
||||
class Standard_TypeMismatch;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
class TNaming_TranslateTool;
|
||||
DEFINE_STANDARD_HANDLE(TNaming_TranslateTool, MMgt_TShared)
|
||||
|
||||
//! tool to copy underlying TShape of a Shape.
|
||||
//! The TranslateTool class is provided to support the
|
||||
//! translation of topological data structures Transient
|
||||
//! to Transient.
|
||||
class TNaming_TranslateTool : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT void Add (TopoDS_Shape& S1, const TopoDS_Shape& S2) const;
|
||||
|
||||
Standard_EXPORT void MakeVertex (TopoDS_Shape& S) const;
|
||||
|
||||
Standard_EXPORT void MakeEdge (TopoDS_Shape& S) const;
|
||||
|
||||
Standard_EXPORT void MakeWire (TopoDS_Shape& S) const;
|
||||
|
||||
Standard_EXPORT void MakeFace (TopoDS_Shape& S) const;
|
||||
|
||||
Standard_EXPORT void MakeShell (TopoDS_Shape& S) const;
|
||||
|
||||
Standard_EXPORT void MakeSolid (TopoDS_Shape& S) const;
|
||||
|
||||
Standard_EXPORT void MakeCompSolid (TopoDS_Shape& S) const;
|
||||
|
||||
Standard_EXPORT void MakeCompound (TopoDS_Shape& S) const;
|
||||
|
||||
Standard_EXPORT void UpdateVertex (const TopoDS_Shape& S1, TopoDS_Shape& S2, TColStd_IndexedDataMapOfTransientTransient& M) const;
|
||||
|
||||
Standard_EXPORT void UpdateEdge (const TopoDS_Shape& S1, TopoDS_Shape& S2, TColStd_IndexedDataMapOfTransientTransient& M) const;
|
||||
|
||||
Standard_EXPORT void UpdateFace (const TopoDS_Shape& S1, TopoDS_Shape& S2, TColStd_IndexedDataMapOfTransientTransient& M) const;
|
||||
|
||||
Standard_EXPORT void UpdateShape (const TopoDS_Shape& S1, TopoDS_Shape& S2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TNaming_TranslateTool,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_TranslateTool_HeaderFile
|
@@ -1,56 +0,0 @@
|
||||
-- Created on: 1999-06-30
|
||||
-- Created by: Sergey ZARITCHNY
|
||||
-- Copyright (c) 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.
|
||||
|
||||
private class Translator from TNaming
|
||||
|
||||
---Purpose: only for Shape Copy test - to move in DNaming
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
DataMapOfShapeShape from TopTools,
|
||||
IndexedDataMapOfTransientTransient from TColStd
|
||||
|
||||
is
|
||||
|
||||
Create returns Translator from TNaming;
|
||||
|
||||
Add(me : in out; aShape : Shape from TopoDS);
|
||||
|
||||
Perform (me : in out);
|
||||
|
||||
IsDone(me)
|
||||
returns Boolean from Standard;
|
||||
|
||||
Copied(me; aShape : Shape from TopoDS)
|
||||
returns Shape from TopoDS;
|
||||
---Purpose: returns copied shape
|
||||
---C++ : return const
|
||||
|
||||
Copied(me)
|
||||
returns DataMapOfShapeShape from TopTools;
|
||||
---C++ : return const&
|
||||
---Purpose: returns DataMap of results; (shape <-> copied shape)
|
||||
DumpMap(me; isWrite : Boolean from Standard = Standard_False);
|
||||
|
||||
fields
|
||||
|
||||
myIsDone : Boolean from Standard;
|
||||
myMap : IndexedDataMapOfTransientTransient from TColStd;
|
||||
myDataMapOfResults : DataMapOfShapeShape from TopTools;
|
||||
-- myListOfShape : ListOfShape from TopTools;
|
||||
-- myListOfResult : ListOfShape from TopTools;
|
||||
|
||||
end Translator;
|
@@ -14,30 +14,29 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_Translator.ixx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_TFace.hxx>
|
||||
#include <BRep_TVertex.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
|
||||
#include <TopoDS_TShape.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <TNaming_CopyShape.hxx>
|
||||
#include <TNaming_Translator.hxx>
|
||||
#include <TopLoc_Datum3D.hxx>
|
||||
#include <BRep_TVertex.hxx>
|
||||
#include <BRep_TFace.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <TopoDS_TWire.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_TCompound.hxx>
|
||||
#include <TopoDS_TCompSolid.hxx>
|
||||
#include <TopoDS_TShape.hxx>
|
||||
#include <TopoDS_TShell.hxx>
|
||||
#include <TopoDS_TSolid.hxx>
|
||||
#include <TopoDS_TCompSolid.hxx>
|
||||
#include <TopoDS_TCompound.hxx>
|
||||
#include <TNaming_CopyShape.hxx>
|
||||
#include <TopoDS_TWire.hxx>
|
||||
#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : TNaming_Translator
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
TNaming_Translator::TNaming_Translator () :myIsDone(Standard_False)
|
||||
{
|
||||
myDataMapOfResults.Clear();
|
||||
|
80
src/TNaming/TNaming_Translator.hxx
Normal file
80
src/TNaming/TNaming_Translator.hxx
Normal file
@@ -0,0 +1,80 @@
|
||||
// Created on: 1999-06-30
|
||||
// Created by: Sergey ZARITCHNY
|
||||
// Copyright (c) 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 _TNaming_Translator_HeaderFile
|
||||
#define _TNaming_Translator_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
//! only for Shape Copy test - to move in DNaming
|
||||
class TNaming_Translator
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT TNaming_Translator();
|
||||
|
||||
Standard_EXPORT void Add (const TopoDS_Shape& aShape);
|
||||
|
||||
Standard_EXPORT void Perform();
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDone() const;
|
||||
|
||||
//! returns copied shape
|
||||
Standard_EXPORT const TopoDS_Shape Copied (const TopoDS_Shape& aShape) const;
|
||||
|
||||
//! returns DataMap of results; (shape <-> copied shape)
|
||||
Standard_EXPORT const TopTools_DataMapOfShapeShape& Copied() const;
|
||||
|
||||
Standard_EXPORT void DumpMap (const Standard_Boolean isWrite = Standard_False) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean myIsDone;
|
||||
TColStd_IndexedDataMapOfTransientTransient myMap;
|
||||
TopTools_DataMapOfShapeShape myDataMapOfResults;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_Translator_HeaderFile
|
@@ -1,143 +0,0 @@
|
||||
-- Created on: 1997-02-05
|
||||
-- Created by: Yves FRICAUD
|
||||
-- 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.
|
||||
|
||||
private class UsedShapes from TNaming inherits Attribute from TDF
|
||||
|
||||
---Purpose: Global attribute located under root label to store all
|
||||
-- the shapes handled by the framework
|
||||
-- Set of Shapes Used in a Data from TDF
|
||||
-- Only one instance by Data, it always
|
||||
-- Stored as Attribute of The Root.
|
||||
|
||||
uses
|
||||
GUID from Standard,
|
||||
DataMapOfShapePtrRefShape from TNaming,
|
||||
RelocationTable from TDF,
|
||||
AttributeIndexedMap from TDF,
|
||||
Attribute from TDF,
|
||||
AttributeDelta from TDF,
|
||||
DeltaOnAddition from TDF,
|
||||
DeltaOnRemoval from TDF,
|
||||
Delta from TDF,
|
||||
DataSet from TDF
|
||||
|
||||
is
|
||||
|
||||
Create returns UsedShapes from TNaming
|
||||
is private;
|
||||
|
||||
Destroy(me : mutable);
|
||||
---C++: alias ~
|
||||
|
||||
Map (me: mutable) returns DataMapOfShapePtrRefShape from TNaming;
|
||||
---C++: return &
|
||||
---C++: inline
|
||||
|
||||
ID(me) returns GUID from Standard
|
||||
is redefined static;
|
||||
---Purpose: Returns the ID of the attribute.
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
GetID(myclass) returns GUID from Standard;
|
||||
---Purpose: Returns the ID: 2a96b614-ec8b-11d0-bee7-080009dc3333.
|
||||
---C++: return const &
|
||||
|
||||
BackupCopy(me) returns Attribute from TDF
|
||||
is redefined;
|
||||
---Purpose: Copies the attribute contents into a new other
|
||||
-- attribute. It is used by Backup().
|
||||
|
||||
Restore(me: mutable; anAttribute : Attribute from TDF)
|
||||
is redefined;
|
||||
---Purpose: Restores the contents from <anAttribute> into this
|
||||
-- one. It is used when aborting a transaction.
|
||||
|
||||
BeforeRemoval(me: mutable)
|
||||
is redefined;
|
||||
---Purpose: Clears the table.
|
||||
|
||||
AfterUndo(me: mutable;
|
||||
anAttDelta : AttributeDelta from TDF;
|
||||
forceIt : Boolean from Standard = Standard_False)
|
||||
returns Boolean from Standard
|
||||
is redefined;
|
||||
---Purpose: Something to do after applying <anAttDelta>.
|
||||
|
||||
|
||||
---Category: Delta generation
|
||||
-- =================================================
|
||||
|
||||
DeltaOnAddition(me)
|
||||
returns DeltaOnAddition from TDF is redefined;
|
||||
---Purpose : this method returns a null handle (no delta).
|
||||
|
||||
|
||||
|
||||
DeltaOnRemoval(me)
|
||||
returns DeltaOnRemoval from TDF is redefined;
|
||||
---Purpose : this method returns a null handle (no delta).
|
||||
|
||||
|
||||
|
||||
-- Copy use methods
|
||||
-- ----------------
|
||||
|
||||
NewEmpty(me)
|
||||
returns Attribute from TDF
|
||||
is redefined;
|
||||
---Purpose: Returns an new empty attribute from the good end
|
||||
-- type. It is used by the copy algorithm.
|
||||
|
||||
Paste(me;
|
||||
intoAttribute : Attribute from TDF;
|
||||
aRelocTationable : RelocationTable from TDF)
|
||||
is redefined;
|
||||
---Purpose: This method is different from the "Copy" one,
|
||||
-- because it is used when copying an attribute from
|
||||
-- a source structure into a target structure. This
|
||||
-- method pastes the current attribute to the label
|
||||
-- corresponding to the insertor. The pasted
|
||||
-- attribute may be a brand new one or a new version
|
||||
-- of the previous one.
|
||||
|
||||
References(me; aDataSet : DataSet from TDF)
|
||||
is redefined;
|
||||
---Purpose: Adds the directly referenced attributes and labels
|
||||
-- to <aDataSet>. "Directly" means we have only to
|
||||
-- look at the first level of references.
|
||||
--
|
||||
-- For this, use only the AddLabel() & AddAttribute()
|
||||
-- from DataSet and do not try to modify information
|
||||
-- previously stored in <aDataSet>.
|
||||
|
||||
|
||||
-- Miscelleaneous
|
||||
-- --------------
|
||||
Dump(me; anOS : in out OStream from Standard)
|
||||
returns OStream from Standard
|
||||
is redefined ;
|
||||
---Purpose: Dumps the attribute on <aStream>.
|
||||
---C++ : return &
|
||||
|
||||
|
||||
fields
|
||||
myMap : DataMapOfShapePtrRefShape from TNaming;
|
||||
|
||||
friends
|
||||
class Builder from TNaming
|
||||
|
||||
end UsedShapes;
|
@@ -14,20 +14,26 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <TNaming_UsedShapes.ixx>
|
||||
|
||||
#include <Standard_GUID.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <TDF_AttributeDelta.hxx>
|
||||
#include <TDF_DataSet.hxx>
|
||||
#include <TDF_DeltaOnAddition.hxx>
|
||||
#include <TDF_DeltaOnRemoval.hxx>
|
||||
#include <TDF_RelocationTable.hxx>
|
||||
#include <TNaming_Builder.hxx>
|
||||
#include <TNaming_DataMapIteratorOfDataMapOfShapePtrRefShape.hxx>
|
||||
#include <TNaming_RefShape.hxx>
|
||||
#include <TNaming_PtrNode.hxx>
|
||||
|
||||
#include <TNaming_RefShape.hxx>
|
||||
#include <TNaming_UsedShapes.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Standard_GUID& TNaming_UsedShapes::GetID()
|
||||
{
|
||||
static Standard_GUID TNaming_UsedShapesID("c4ef4201-568f-11d1-8940-080009dc3333");
|
||||
|
137
src/TNaming/TNaming_UsedShapes.hxx
Normal file
137
src/TNaming/TNaming_UsedShapes.hxx
Normal file
@@ -0,0 +1,137 @@
|
||||
// Created on: 1997-02-05
|
||||
// Created by: Yves FRICAUD
|
||||
// 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 _TNaming_UsedShapes_HeaderFile
|
||||
#define _TNaming_UsedShapes_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TNaming_DataMapOfShapePtrRefShape.hxx>
|
||||
#include <TDF_Attribute.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
class TNaming_Builder;
|
||||
class Standard_GUID;
|
||||
class TDF_Attribute;
|
||||
class TDF_AttributeDelta;
|
||||
class TDF_DeltaOnAddition;
|
||||
class TDF_DeltaOnRemoval;
|
||||
class TDF_RelocationTable;
|
||||
class TDF_DataSet;
|
||||
|
||||
|
||||
class TNaming_UsedShapes;
|
||||
DEFINE_STANDARD_HANDLE(TNaming_UsedShapes, TDF_Attribute)
|
||||
|
||||
//! Global attribute located under root label to store all
|
||||
//! the shapes handled by the framework
|
||||
//! Set of Shapes Used in a Data from TDF
|
||||
//! Only one instance by Data, it always
|
||||
//! Stored as Attribute of The Root.
|
||||
class TNaming_UsedShapes : public TDF_Attribute
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT void Destroy();
|
||||
~TNaming_UsedShapes()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
TNaming_DataMapOfShapePtrRefShape& Map();
|
||||
|
||||
//! Returns the ID of the attribute.
|
||||
const Standard_GUID& ID() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the ID: 2a96b614-ec8b-11d0-bee7-080009dc3333.
|
||||
Standard_EXPORT static const Standard_GUID& GetID();
|
||||
|
||||
//! Copies the attribute contents into a new other
|
||||
//! attribute. It is used by Backup().
|
||||
Standard_EXPORT virtual Handle(TDF_Attribute) BackupCopy() const Standard_OVERRIDE;
|
||||
|
||||
//! Restores the contents from <anAttribute> into this
|
||||
//! one. It is used when aborting a transaction.
|
||||
Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& anAttribute) Standard_OVERRIDE;
|
||||
|
||||
//! Clears the table.
|
||||
Standard_EXPORT virtual void BeforeRemoval() Standard_OVERRIDE;
|
||||
|
||||
//! Something to do after applying <anAttDelta>.
|
||||
Standard_EXPORT virtual Standard_Boolean AfterUndo (const Handle(TDF_AttributeDelta)& anAttDelta, const Standard_Boolean forceIt = Standard_False) Standard_OVERRIDE;
|
||||
|
||||
//! this method returns a null handle (no delta).
|
||||
Standard_EXPORT virtual Handle(TDF_DeltaOnAddition) DeltaOnAddition() const Standard_OVERRIDE;
|
||||
|
||||
//! this method returns a null handle (no delta).
|
||||
Standard_EXPORT virtual Handle(TDF_DeltaOnRemoval) DeltaOnRemoval() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns an new empty attribute from the good end
|
||||
//! type. It is used by the copy algorithm.
|
||||
Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
|
||||
|
||||
//! This method is different from the "Copy" one,
|
||||
//! because it is used when copying an attribute from
|
||||
//! a source structure into a target structure. This
|
||||
//! method pastes the current attribute to the label
|
||||
//! corresponding to the insertor. The pasted
|
||||
//! attribute may be a brand new one or a new version
|
||||
//! of the previous one.
|
||||
Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& intoAttribute, const Handle(TDF_RelocationTable)& aRelocTationable) const Standard_OVERRIDE;
|
||||
|
||||
//! Adds the directly referenced attributes and labels
|
||||
//! to <aDataSet>. "Directly" means we have only to
|
||||
//! look at the first level of references.
|
||||
//!
|
||||
//! For this, use only the AddLabel() & AddAttribute()
|
||||
//! from DataSet and do not try to modify information
|
||||
//! previously stored in <aDataSet>.
|
||||
Standard_EXPORT virtual void References (const Handle(TDF_DataSet)& aDataSet) const Standard_OVERRIDE;
|
||||
|
||||
//! Dumps the attribute on <aStream>.
|
||||
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
|
||||
|
||||
friend class TNaming_Builder;
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(TNaming_UsedShapes,TDF_Attribute)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT TNaming_UsedShapes();
|
||||
|
||||
TNaming_DataMapOfShapePtrRefShape myMap;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <TNaming_UsedShapes.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _TNaming_UsedShapes_HeaderFile
|
Reference in New Issue
Block a user