1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-01 10:26:12 +03:00
occt/src/BRepTest/BRepTest.hxx
emv 4f7d41eac3 0029604: Uniform mechanism providing History of shape's modifications for OCCT algorithms in DRAW
Implementation of the mechanism for unification of the history commands for all OCCT algorithms.
The following Draw commands should be used to track the history of shapes modifications of any operation:
- modified - to find the shapes modified from the given shape in the given history.
- generated - to find the shapes generated from the given shape in the given history.
- isdeleted - to check if the given shape has been deleted during operation.

The mechanism allows fast & easy enabling of the DRAW history support for the algorithms supporting the history on the API level (i.e. the algorithm should have the methods Modified(), Generated() and IsDeleted()).
To enable the draw history support it is necessary to store the history of the algorithm into the session. For instance:

TopTools_ListOfShape Objects = ...; // Objects
TopTools_ListOfShape Tools = ...; // Tools

BRepAlgoAPI_Cut aCut(Objects, Tools); // Boolean cut operation

BRepTest_Objects::SetHistory(Objects, aCut); // Store the history for the Objects (overwrites the history in the session)
BRepTest_Objects::AddHistory(Tools, aCut);   // Add the history for the Tools

To get the stored history in draw the command "savehistory" should be used. It saves the history kept in session into a Drawable object with the given name:

# perform cut
bcut r s1 s2

# save history of cut
savehistory cut_history

explode s1 f
modified m cut_history s1_1

The Draw History commands of the following algorithms have been removed:
- Boolean Operations;
- Defeaturing;
- Unify same domain;
- Sweep;
- Thrusections;

All these algorithms have been switched to support the new Draw history mechanism.

The Fillet and Blend algorithms have been also enabled to support history commands.
2018-04-12 13:30:56 +03:00

127 lines
3.7 KiB
C++

// Created on: 1991-06-25
// Created by: Christophe MARION
// Copyright (c) 1991-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 _BRepTest_HeaderFile
#define _BRepTest_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Draw_Interpretor.hxx>
//! Provides commands to test BRep.
class BRepTest
{
public:
DEFINE_STANDARD_ALLOC
//! Defines all the topology commands.
Standard_EXPORT static void AllCommands (Draw_Interpretor& DI);
//! Defines the basic commands.
Standard_EXPORT static void BasicCommands (Draw_Interpretor& DI);
//! Defines the commands to build edges and wires.
Standard_EXPORT static void CurveCommands (Draw_Interpretor& DI);
//! Defines the commands to perform add fillets on
//! wires and edges.
Standard_EXPORT static void Fillet2DCommands (Draw_Interpretor& DI);
//! Defines the commands to build faces and shells.
Standard_EXPORT static void SurfaceCommands (Draw_Interpretor& DI);
//! Defines the commands to build primitives.
Standard_EXPORT static void PrimitiveCommands (Draw_Interpretor& DI);
//! Defines the commands to build primitives.
Standard_EXPORT static void FillingCommands (Draw_Interpretor& DI);
//! Defines the commands to sweep shapes.
Standard_EXPORT static void SweepCommands (Draw_Interpretor& DI);
//! Defines the commands to perform topological
//! operations.
Standard_EXPORT static void TopologyCommands (Draw_Interpretor& DI);
//! Defines the commands to perform add fillets on
//! shells.
Standard_EXPORT static void FilletCommands (Draw_Interpretor& DI);
//! Defines the commands to perform add chamfers on
//! shells.
Standard_EXPORT static void ChamferCommands (Draw_Interpretor& DI);
//! Defines commands to compute global properties.
Standard_EXPORT static void GPropCommands (Draw_Interpretor& DI);
//! Defines commands to compute and to explore the map of the
//! Bisecting locus.
Standard_EXPORT static void MatCommands (Draw_Interpretor& DI);
//! Defines the commands to modify draft angles of the
//! faces of a shape.
Standard_EXPORT static void DraftAngleCommands (Draw_Interpretor& DI);
//! Defines the commands to create features on a shape.
Standard_EXPORT static void FeatureCommands (Draw_Interpretor& DI);
//! Defines the auxiliary topology commands.
Standard_EXPORT static void OtherCommands (Draw_Interpretor& DI);
//! Defines the extrema commands.
Standard_EXPORT static void ExtremaCommands (Draw_Interpretor& DI);
//! Defines the checkshape command.
Standard_EXPORT static void CheckCommands (Draw_Interpretor& DI);
//! Defines the placement command.
Standard_EXPORT static void PlacementCommands (Draw_Interpretor& DI);
//! Defines the commands to project a wire on a shape.
Standard_EXPORT static void ProjectionCommands (Draw_Interpretor& DI);
//! Defines the History commands for the algorithms.
Standard_EXPORT static void HistoryCommands (Draw_Interpretor& DI);
protected:
private:
};
#endif // _BRepTest_HeaderFile