mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-05-25 14:40:49 +05:00
This commit was generated by cvs2git to create tag 'DCQ_03_12_03'.
Sprout from DCQ_1_2_1 2003-11-20 12:43:34 UTC dcq <dcq@opencascade.com> 'DCQ : Debug Filling' Delete: src/SKETCHER/GEOM_Sketcher.cxx src/SKETCHER/GEOM_Sketcher.h src/SKETCHER/GEOM_SketcherStatus.h src/SKETCHER/Makefile.in
This commit is contained in:
parent
438f702fc7
commit
ed86c046d4
File diff suppressed because it is too large
Load Diff
@ -1,201 +0,0 @@
|
||||
// GEOM SKETCHER : basic sketcher
|
||||
//
|
||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||
//
|
||||
//
|
||||
//
|
||||
// File : GEOM_Sketcher.h
|
||||
// Author : Nicolas REJNERI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#include "GEOM_SketcherStatus.h"
|
||||
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <AIS_Axis.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <AIS_LengthDimension.hxx>
|
||||
#include <AIS_RadiusDimension.hxx>
|
||||
#include <AIS_AngleDimension.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <TColStd_SequenceOfInteger.hxx>
|
||||
#include <TColgp_SequenceOfPnt2d.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
|
||||
class Sketch
|
||||
{
|
||||
public:
|
||||
Sketch();
|
||||
~Sketch();
|
||||
Sketch(const Handle(V3d_Viewer)& aViewer);
|
||||
Sketch(const Handle(V3d_Viewer)& aViewer,
|
||||
const Quantity_Color& anAxisColor,
|
||||
const Quantity_Color& aCurrentColor,
|
||||
const Quantity_Color& aWireColor);
|
||||
|
||||
static void fitInResol(Standard_Real &toFit,
|
||||
Standard_Boolean minIsResol = Standard_False);
|
||||
|
||||
void MakeCurrentEdge(const Standard_Integer Xp ,
|
||||
const Standard_Integer Yp ,
|
||||
const Handle(V3d_View)& aView );
|
||||
|
||||
void MakeCurrentEdge(const Standard_Real X, const Standard_Real Y);
|
||||
|
||||
Standard_Boolean SetDimension(Standard_Real& aValue);
|
||||
void SetDimension(Standard_Real& deltaX,Standard_Real& deltaY);
|
||||
|
||||
void SetXDimension(Standard_Real& deltaX);
|
||||
void SetYDimension(Standard_Real& deltaY);
|
||||
|
||||
void SetSegmentAngle(Standard_Real& aValue);
|
||||
Standard_Real GetSegmentAngle();
|
||||
|
||||
void ValidateEdge();
|
||||
|
||||
TopoDS_Wire Close();
|
||||
TopoDS_Wire End();
|
||||
|
||||
void Clear();
|
||||
|
||||
Standard_Boolean Delete();
|
||||
|
||||
void SetPlane(const Handle(Geom_Plane)& aPlane);
|
||||
|
||||
void SetWireColor(const Quantity_Color& aColor);
|
||||
void SetCurrentColor(const Quantity_Color& aColor);
|
||||
void SetAxisColor(const Quantity_Color& aColor);
|
||||
|
||||
void SetParameterVisibility(const TypeOfParameter atype,
|
||||
const Standard_Boolean OnOff);
|
||||
|
||||
void HiligthWithColor(const TypeOfParameter atype,
|
||||
const Quantity_NameOfColor acolor);
|
||||
void Unhiligth(const TypeOfParameter atype);
|
||||
|
||||
Standard_Boolean IsValidCurrentParameter(const TypeOfParameter atype);
|
||||
|
||||
void SetParameterValue(const TypeOfParameter atype, Standard_Real aValue);
|
||||
|
||||
void ChangeMode(const SketchStatus aMode);
|
||||
|
||||
void SetTransitionStatus(const TransitionStatus aStatus);
|
||||
|
||||
SketchStatus GetCurrentStatus();
|
||||
Standard_Integer GetmyEdgesNumber();
|
||||
|
||||
private :
|
||||
|
||||
void Init();
|
||||
|
||||
void MakeCurrentSegment(Standard_Real X, Standard_Real Y);
|
||||
|
||||
void MakeCurrentArc(Standard_Real X, Standard_Real Y);
|
||||
|
||||
void DisplayCurrentEdge();
|
||||
|
||||
void DisplayLengthDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
|
||||
void DisplayXDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
|
||||
void DisplayYDimension(const TopoDS_Vertex& V1,const TopoDS_Vertex& V2);
|
||||
void DisplayAngleDimension();
|
||||
void DisplayRadiusDimension();
|
||||
|
||||
void AddEdgeToWire();
|
||||
|
||||
void RemoveLastEdge();
|
||||
|
||||
void CreateConstraints();
|
||||
|
||||
private:
|
||||
// Current status of construction
|
||||
SketchStatus myCurrentStatus;
|
||||
// Transition status between arcs and segments
|
||||
TransitionStatus myTransitionStatus;
|
||||
// Current wire
|
||||
BRepBuilderAPI_MakeWire myCurrentWire;
|
||||
// Current presentable wire
|
||||
Handle_AIS_Shape myPresentableWire;
|
||||
// Number of edges into the current wire
|
||||
Standard_Integer myEdgesNumber;
|
||||
// Store for each edge how it has been built i.d the value of myCurrentStatus
|
||||
TColStd_SequenceOfInteger myConstructionMode;
|
||||
// Store for each edge how it has been built i.d the value of myTransitionStatus
|
||||
TColStd_SequenceOfInteger myConstraintMode;
|
||||
// Current edge
|
||||
TopoDS_Shape myCurrentEdge;
|
||||
// Previous edge
|
||||
TopoDS_Edge myPreviousEdge;
|
||||
// List of points to interpolate when computing a curve by interpolation
|
||||
TColgp_SequenceOfPnt2d myPointsToInterpolate;
|
||||
// Tangent vector at beginning of curve
|
||||
gp_Vec2d myTangentVector;
|
||||
// Tangent flag at beginning og curve
|
||||
Standard_Boolean myTangentFlag;
|
||||
|
||||
// Origin of sketch
|
||||
TopoDS_Vertex myFirstPointSketch;
|
||||
// Last x coordinate of end point of previous edge or picked point
|
||||
Standard_Real myLastX;
|
||||
// Last y coordinate of end point of previous edge or picked point
|
||||
Standard_Real myLastY;
|
||||
// angle between 2 segments when an ANGLE TransitionStatus is set.
|
||||
Standard_Real mySegmentAngle;
|
||||
// Length of segment when the length of the segment is fixed before the angle
|
||||
Standard_Real mySegmentLength;
|
||||
// Value of X fixed coordinate
|
||||
Standard_Real mySegmentX;
|
||||
// Value of Y fixed Coordinate
|
||||
Standard_Real mySegmentY;
|
||||
Handle_AIS_Shape myPresentableEdge; // Current presentable edge
|
||||
Handle_AIS_LengthDimension myLengthDimension;// For display of current length segment dimension
|
||||
Handle_AIS_LengthDimension myXDimension; // For display of current X segment dimension
|
||||
Handle_AIS_LengthDimension myYDimension; // For display of current Y segment dimension
|
||||
Handle_AIS_LengthDimension myRadiusDimension;// For display of current radius dimension
|
||||
Handle_AIS_AngleDimension myAngleDimension; // For display of current angle dimension
|
||||
Standard_Boolean myIsLengthDimensionVisible; // Visibility flag for LengthDimension
|
||||
Standard_Boolean myIsXDimensionVisible; // Visibility flag for X Dimension
|
||||
Standard_Boolean myIsYDimensionVisible; // Visibility flag for Y Dimension
|
||||
Standard_Boolean myIsRadiusDimensionVisible; // Visibility flag for RadiusDimension
|
||||
Standard_Boolean myIsAngleDimensionVisible; // Visibility flag for AngleDimension
|
||||
Handle_AIS_Axis myPresentableMediatrice; // Chord mediatrice of current circle as a presentable object
|
||||
Handle_Geom2d_Line myMediatrice; // Chord mediatrice of current circle as a 2d line
|
||||
Handle_AIS_Shape myCenterCircle; // to visualise center of current arc
|
||||
|
||||
Handle_AIS_Axis myHAxis; // Horizontal axis
|
||||
Handle_AIS_Axis myVAxis; // Vertical axis
|
||||
Handle_AIS_Axis myAngularAxis; // Axis making a predefined angle with the previous edge
|
||||
|
||||
Quantity_Color myWireColor; // Color of wire and of build edges
|
||||
Quantity_Color myCurrentColor; // Color of edge under construction
|
||||
Quantity_Color myAxisColor; // Color for axis
|
||||
Handle_AIS_InteractiveContext myInteractiveContext; // Interactive context for display management
|
||||
|
||||
Handle_Geom_Plane myPlane; // Plane of sketch
|
||||
|
||||
BRepBuilderAPI_MakeWire myPasteWire;
|
||||
Standard_Integer myPasteEdgesNumber;
|
||||
TColStd_SequenceOfInteger myPasteConstructionMode;
|
||||
TColStd_SequenceOfInteger myPasteConstraintMode;
|
||||
};
|
@ -1,53 +0,0 @@
|
||||
// GEOM SKETCHER : basic sketcher
|
||||
//
|
||||
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||
//
|
||||
//
|
||||
//
|
||||
// File : GEOM_SketcherStatus.h
|
||||
// Author : Nicolas REJNERI
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
enum TransitionStatus {
|
||||
NOCONSTRAINT, // no constraint between consecutive edges
|
||||
TANGENT, // arc and segment are tangent
|
||||
PERPENDICULAR,// arc is tangent to the perpendicular to the segment
|
||||
ANGLE, // Angular constraint between 2 segments
|
||||
LENGTH_FIXED, // Length of segment has been fixed
|
||||
X_FIXED, // X coordinate for segment has been fixed
|
||||
Y_FIXED // Y coordinate for segment has been fixed
|
||||
};
|
||||
|
||||
enum TypeOfParameter {
|
||||
ANGLE_PARAMETER,
|
||||
LENGTH_PARAMETER,
|
||||
RADIUS_PARAMETER,
|
||||
XVALUE_PARAMETER,
|
||||
YVALUE_PARAMETER
|
||||
};
|
||||
|
||||
enum SketchStatus {
|
||||
BEGIN_SKETCH, // Begin sketch; no edges created yet
|
||||
SEGMENT, // Current mode for creation is segment
|
||||
ARC_CHORD, // Current mode for creation is arc by chord
|
||||
ARC_CHORD_END,// Chord validated, waiting for radius or center
|
||||
END_SKETCH // End sketch
|
||||
};
|
@ -1,57 +0,0 @@
|
||||
# GEOM SKETCHER : basic sketcher
|
||||
#
|
||||
# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
|
||||
#
|
||||
#
|
||||
#
|
||||
# File : Makefile.in
|
||||
# Author : Patrick GOLDBRONN (CEA)
|
||||
# Module : GEOM
|
||||
# $Header$
|
||||
|
||||
top_srcdir=@top_srcdir@
|
||||
top_builddir=../..
|
||||
srcdir=@srcdir@
|
||||
VPATH=.:@srcdir@:@top_srcdir@/idl
|
||||
|
||||
|
||||
@COMMENCE@
|
||||
|
||||
# Libraries targets
|
||||
LIB = libGEOMSketcher.la
|
||||
LIB_SRC = GEOM_Sketcher.cxx
|
||||
LIB_CLIENT_IDL = SALOME_Component.idl SALOMEDS.idl SALOME_Exception.idl GEOM_Shape.idl GEOM_Gen.idl
|
||||
|
||||
# header files
|
||||
EXPORT_HEADERS= GEOM_Sketcher.h \
|
||||
GEOM_SketcherStatus.h
|
||||
|
||||
# additionnal information to compil and link file
|
||||
CPPFLAGS += $(OCC_INCLUDES) $(QT_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
|
||||
CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
||||
LDFLAGS += $(OCC_KERNEL_LIBS) $(OCC_MODELER_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome
|
||||
|
||||
# additional file to be cleaned
|
||||
MOSTLYCLEAN =
|
||||
CLEAN =
|
||||
DISTCLEAN =
|
||||
|
||||
@CONCLUDE@
|
||||
|
Loading…
x
Reference in New Issue
Block a user