0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / ShapeBuild / ShapeBuild_ReShape.hxx
CommitLineData
42cf5bc1 1// Created on: 1998-06-03
2// Created by: data exchange team
3// Copyright (c) 1998-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _ShapeBuild_ReShape_HeaderFile
18#define _ShapeBuild_ReShape_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <BRepTools_ReShape.hxx>
24#include <TopAbs_ShapeEnum.hxx>
25#include <Standard_Integer.hxx>
26#include <Standard_Boolean.hxx>
27#include <ShapeExtend_Status.hxx>
28class TopoDS_Shape;
29
9fd2d2c3 30// resolve name collisions with X11 headers
31#ifdef Status
32 #undef Status
33#endif
42cf5bc1 34
35class ShapeBuild_ReShape;
36DEFINE_STANDARD_HANDLE(ShapeBuild_ReShape, BRepTools_ReShape)
37
38//! Rebuilds a Shape by making pre-defined substitutions on some
39//! of its components
40//!
41//! In a first phase, it records requests to replace or remove
42//! some individual shapes
43//! For each shape, the last given request is recorded
44//! Requests may be applied "Oriented" (i.e. only to an item with
45//! the SAME orientation) or not (the orientation of replacing
46//! shape is respectful of that of the original one)
47//!
48//! Then, these requests may be applied to any shape which may
49//! contain one or more of these individual shapes
50class ShapeBuild_ReShape : public BRepTools_ReShape
51{
52
53public:
54
55
56 //! Returns an empty Reshape
57 Standard_EXPORT ShapeBuild_ReShape();
669cd76e 58
42cf5bc1 59 //! Applies the substitutions requests to a shape
60 //!
61 //! <until> gives the level of type until which requests are taken
62 //! into account. For subshapes of the type <until> no rebuild
63 //! and futher exploring are done.
64 //! ACTUALLY, NOT IMPLEMENTED BELOW TopAbs_FACE
65 //!
66 //! <buildmode> says how to do on a SOLID,SHELL ... if one of its
67 //! sub-shapes has been changed:
68 //! 0: at least one Replace or Remove -> COMPOUND, else as such
69 //! 1: at least one Remove (Replace are ignored) -> COMPOUND
70 //! 2: Replace and Remove are both ignored
71 //! If Replace/Remove are ignored or absent, the result as same
72 //! type as the starting shape
669cd76e 73 Standard_EXPORT virtual TopoDS_Shape Apply (const TopoDS_Shape& shape, const TopAbs_ShapeEnum until, const Standard_Integer buildmode);
42cf5bc1 74
75 //! Applies the substitutions requests to a shape.
76 //!
77 //! <until> gives the level of type until which requests are taken
78 //! into account. For subshapes of the type <until> no rebuild
79 //! and futher exploring are done.
80 //!
81 //! NOTE: each subshape can be replaced by shape of the same type
82 //! or by shape containing only shapes of that type (for
83 //! example, TopoDS_Edge can be replaced by TopoDS_Edge,
84 //! TopoDS_Wire or TopoDS_Compound containing TopoDS_Edges).
85 //! If incompatible shape type is encountered, it is ignored
86 //! and flag FAIL1 is set in Status.
87 Standard_EXPORT virtual TopoDS_Shape Apply (const TopoDS_Shape& shape, const TopAbs_ShapeEnum until = TopAbs_SHAPE) Standard_OVERRIDE;
88
89 //! Returns a complete substitution status for a shape
90 //! 0 : not recorded, <newsh> = original <shape>
91 //! < 0: to be removed, <newsh> is NULL
92 //! > 0: to be replaced, <newsh> is a new item
93 //! If <last> is False, returns status and new shape recorded in
94 //! the map directly for the shape, if True and status > 0 then
95 //! recursively searches for the last status and new shape.
96 Standard_EXPORT virtual Standard_Integer Status (const TopoDS_Shape& shape, TopoDS_Shape& newsh, const Standard_Boolean last = Standard_False) Standard_OVERRIDE;
97
98 //! Queries the status of last call to Apply(shape,enum)
99 //! OK : no (sub)shapes replaced or removed
100 //! DONE1: source (starting) shape replaced
101 //! DONE2: source (starting) shape removed
102 //! DONE3: some subshapes replaced
103 //! DONE4: some subshapes removed
104 //! FAIL1: some replacements not done because of bad type of subshape
105 Standard_EXPORT virtual Standard_Boolean Status (const ShapeExtend_Status status) const;
106
107
108
109
92efcf78 110 DEFINE_STANDARD_RTTIEXT(ShapeBuild_ReShape,BRepTools_ReShape)
42cf5bc1 111
112protected:
113
114
115
116
117private:
118
119
120
121
122};
123
124
125
126
127
128
129
130#endif // _ShapeBuild_ReShape_HeaderFile