1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +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:
abv 2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

View File

@ -1,186 +1,186 @@
n NCollection
p BSplCLib
p BSplSLib
p Bnd
p BVH
p CSLib
p Convert
p Dico
p ElCLib
p ElSLib
p Expr
p ExprIntrp
p FSD
p GeomAbs
p MMgt
p Message
p OSD
p PLib
p Plugin
p Poly
p Precision
p Quantity
p Resource
p Standard
p StdFail
p Storage
p TColStd
p TColgp
p TCollection
p TShort
p TopLoc
p Units
p UnitsAPI
p gp
p math
n BSplCLib
n BSplSLib
n Bnd
n BVH
n CSLib
n Convert
n Dico
n ElCLib
n ElSLib
n Expr
n ExprIntrp
n FSD
n GeomAbs
n MMgt
n Message
n OSD
n PLib
n Plugin
n Poly
n Precision
n Quantity
n Resource
n Standard
n StdFail
n Storage
n TColStd
n TColgp
n TCollection
n TShort
n TopLoc
n Units
n UnitsAPI
n gp
n math
r OS
t TKMath
t TKernel
p Adaptor2d
p Adaptor3d
p AdvApp2Var
p AdvApprox
p AppCont
p AppDef
p AppParCurves
p Approx
p BRep
p BRepAdaptor
p BRepLProp
p BRepTools
p BndLib
p CPnts
p Extrema
p FEmTool
p GC
p GCE2d
p GCPnts
p GProp
p Geom
p Geom2d
p Geom2dAdaptor
p Geom2dConvert
p Geom2dLProp
p GeomAdaptor
p GeomConvert
p GeomLProp
p GeomLib
p GeomProjLib
p GeomTools
p Hermit
p IntAna
p IntAna2d
p LProp
p LProp3d
p ProjLib
p TColGeom
p TColGeom2d
p TopAbs
p TopExp
p TopTools
p TopoDS
p gce
n Adaptor2d
n Adaptor3d
n AdvApp2Var
n AdvApprox
n AppCont
n AppDef
n AppParCurves
n Approx
n BRep
n BRepAdaptor
n BRepLProp
n BRepTools
n BndLib
n CPnts
n Extrema
n FEmTool
n GC
n GCE2d
n GCPnts
n GProp
n Geom
n Geom2d
n Geom2dAdaptor
n Geom2dConvert
n Geom2dLProp
n GeomAdaptor
n GeomConvert
n GeomLProp
n GeomLib
n GeomProjLib
n GeomTools
n Hermit
n IntAna
n IntAna2d
n LProp
n LProp3d
n ProjLib
n TColGeom
n TColGeom2d
n TopAbs
n TopExp
n TopTools
n TopoDS
n gce
t TKBRep
t TKG2d
t TKG3d
t TKGeomBase
p AppBlend
p ApproxInt
p BOPTools
p BRepAlgo
p BRepAlgoAPI
p BRepApprox
p BRepBlend
p BRepBndLib
p BRepBuilderAPI
p BRepCheck
p BRepClass
p BRepClass3d
p BRepExtrema
p BRepFeat
p BRepFill
p BRepFilletAPI
p BRepGProp
p BRepIntCurveSurface
p BRepLib
p BRepMAT2d
n AppBlend
n ApproxInt
n BOPTools
n BRepAlgo
n BRepAlgoAPI
n BRepApprox
n BRepBlend
n BRepBndLib
n BRepBuilderAPI
n BRepCheck
n BRepClass
n BRepClass3d
n BRepExtrema
n BRepFeat
n BRepFill
n BRepFilletAPI
n BRepGProp
n BRepIntCurveSurface
n BRepLib
n BRepMAT2d
n BRepMesh
p BRepOffset
p BRepOffsetAPI
p BRepPrim
p BRepPrimAPI
p BRepProj
p BRepSweep
p BRepTopAdaptor
p BiTgte
p Bisector
p Blend
p BlendFunc
p ChFi2d
p ChFi3d
p ChFiDS
p ChFiKPart
p Contap
p Draft
p FairCurve
p FilletSurf
p GccAna
p GccEnt
p GccInt
p Geom2dAPI
p Geom2dGcc
p Geom2dHatch
p Geom2dInt
p GeomAPI
p GeomFill
p GeomInt
p GeomPlate
p HLRAlgo
p HLRBRep
p HLRTopoBRep
p HLRAppli
p Hatch
p HatchGen
p IntCurve
p IntCurveSurface
p IntCurvesFace
p IntImp
p IntImpParGen
p IntPatch
p IntPolyh
p IntRes2d
p IntStart
p IntSurf
p IntTools
p IntWalk
p Intf
p Intrv
p Law
p LocOpe
p LocalAnalysis
p MAT
p MAT2d
p NLPlate
p Plate
p ShapeAlgo
p ShapeAnalysis
p ShapeBuild
p ShapeConstruct
p ShapeCustom
p ShapeExtend
p ShapeFix
p ShapeProcess
p ShapeProcessAPI
p ShapeUpgrade
p Sweep
p TopBas
p TopClass
p TopCnx
p TopOpeBRep
p TopOpeBRepBuild
p TopOpeBRepDS
p TopOpeBRepTool
p TopTrans
n BRepOffset
n BRepOffsetAPI
n BRepPrim
n BRepPrimAPI
n BRepProj
n BRepSweep
n BRepTopAdaptor
n BiTgte
n Bisector
n Blend
n BlendFunc
n ChFi2d
n ChFi3d
n ChFiDS
n ChFiKPart
n Contap
n Draft
n FairCurve
n FilletSurf
n GccAna
n GccEnt
n GccInt
n Geom2dAPI
n Geom2dGcc
n Geom2dHatch
n Geom2dInt
n GeomAPI
n GeomFill
n GeomInt
n GeomPlate
n HLRAlgo
n HLRBRep
n HLRTopoBRep
n HLRAppli
n Hatch
n HatchGen
n IntCurve
n IntCurveSurface
n IntCurvesFace
n IntImp
n IntImpParGen
n IntPatch
n IntPolyh
n IntRes2d
n IntStart
n IntSurf
n IntTools
n IntWalk
n Intf
n Intrv
n Law
n LocOpe
n LocalAnalysis
n MAT
n MAT2d
n NLPlate
n Plate
n ShapeAlgo
n ShapeAnalysis
n ShapeBuild
n ShapeConstruct
n ShapeCustom
n ShapeExtend
n ShapeFix
n ShapeProcess
n ShapeProcessAPI
n ShapeUpgrade
n Sweep
n TopBas
n TopClass
n TopCnx
n TopOpeBRep
n TopOpeBRepBuild
n TopOpeBRepDS
n TopOpeBRepTool
n TopTrans
n XBRepMesh
t TKBO
t TKBool
@ -195,27 +195,27 @@ t TKShHealing
t TKTopAlgo
t TKXMesh
n InterfaceGraphic
p AIS
p Aspect
p DsgPrs
p Graphic3d
p Image
p MeshVS
p OpenGl
p Prs3d
p PrsMgr
p Select3D
p SelectBasics
p SelectMgr
p StdPrs
p StdSelect
p TColQuantity
p V3d
p Visual3d
p Voxel
p WNT
p Xw
p Cocoa
n AIS
n Aspect
n DsgPrs
n Graphic3d
n Image
n MeshVS
n OpenGl
n Prs3d
n PrsMgr
n Select3D
n SelectBasics
n SelectMgr
n StdPrs
n StdSelect
n TColQuantity
n V3d
n Visual3d
n Voxel
n WNT
n Xw
n Cocoa
r Textures
r Shaders
t TKMeshVS
@ -227,41 +227,41 @@ n BinTObjDrivers
n LDOM
n TObj
n XmlTObjDrivers
p AppStd
p AppStdL
p BinDrivers
p BinLDrivers
p BinMDF
p BinMDataStd
p BinMDataXtd
p BinMDocStd
p BinMFunction
p BinMNaming
p BinMPrsStd
p BinObjMgt
p BinTools
p CDF
p CDM
p FWOSDriver
p PCDM
p TDF
p TDataStd
p TDataXtd
p TDocStd
p TFunction
p TNaming
p TPrsStd
p UTL
p XmlDrivers
p XmlLDrivers
p XmlMDF
p XmlMDataStd
p XmlMDataXtd
p XmlMDocStd
p XmlMFunction
p XmlMNaming
p XmlMPrsStd
p XmlObjMgt
n AppStd
n AppStdL
n BinDrivers
n BinLDrivers
n BinMDF
n BinMDataStd
n BinMDataXtd
n BinMDocStd
n BinMFunction
n BinMNaming
n BinMPrsStd
n BinObjMgt
n BinTools
n CDF
n CDM
n FWOSDriver
n PCDM
n TDF
n TDataStd
n TDataXtd
n TDocStd
n TFunction
n TNaming
n TPrsStd
n UTL
n XmlDrivers
n XmlLDrivers
n XmlMDF
n XmlMDataStd
n XmlMDataXtd
n XmlMDocStd
n XmlMFunction
n XmlMNaming
n XmlMPrsStd
n XmlObjMgt
r StdResource
r XmlOcafResource
t FWOSPlugin
@ -279,84 +279,84 @@ t TKXmlL
t TKXmlTObj
n IGESFile
n StepFile
p APIHeaderSection
p BRepToIGES
p BRepToIGESBRep
p BinMXCAFDoc
p BinXCAFDrivers
p Geom2dToIGES
p GeomToIGES
p GeomToStep
p HeaderSection
p IFGraph
p IFSelect
p IGESAppli
p IGESBasic
p IGESCAFControl
p IGESControl
p IGESConvGeom
p IGESData
p IGESDefs
p IGESDimen
p IGESDraw
p IGESGeom
p IGESGraph
p IGESSelect
p IGESSolid
p IGESToBRep
p Interface
p LibCtl
p MoniTool
p RWHeaderSection
p RWStepAP203
p RWStepAP214
p RWStepBasic
p RWStepDimTol
p RWStepElement
p RWStepFEA
p RWStepGeom
p RWStepRepr
p RWStepShape
p RWStepVisual
p RWStl
p STEPCAFControl
p STEPConstruct
p STEPControl
p STEPEdit
p STEPSelections
p StepAP203
p StepAP209
p StepAP214
p StepBasic
p StepData
p StepDimTol
p StepElement
p StepFEA
p StepGeom
p StepRepr
p StepSelect
p StepShape
p StepToGeom
p StepToTopoDS
p StepVisual
p StlAPI
p StlMesh
p StlTransfer
p TopoDSToStep
p Transfer
p TransferBRep
p UnitsMethods
p Vrml
p VrmlAPI
p VrmlConverter
p VrmlData
p XCAFApp
p XCAFDoc
p XCAFPrs
p XSAlgo
p XSControl
p XmlMXCAFDoc
p XmlXCAFDrivers
n APIHeaderSection
n BRepToIGES
n BRepToIGESBRep
n BinMXCAFDoc
n BinXCAFDrivers
n Geom2dToIGES
n GeomToIGES
n GeomToStep
n HeaderSection
n IFGraph
n IFSelect
n IGESAppli
n IGESBasic
n IGESCAFControl
n IGESControl
n IGESConvGeom
n IGESData
n IGESDefs
n IGESDimen
n IGESDraw
n IGESGeom
n IGESGraph
n IGESSelect
n IGESSolid
n IGESToBRep
n Interface
n LibCtl
n MoniTool
n RWHeaderSection
n RWStepAP203
n RWStepAP214
n RWStepBasic
n RWStepDimTol
n RWStepElement
n RWStepFEA
n RWStepGeom
n RWStepRepr
n RWStepShape
n RWStepVisual
n RWStl
n STEPCAFControl
n STEPConstruct
n STEPControl
n STEPEdit
n STEPSelections
n StepAP203
n StepAP209
n StepAP214
n StepBasic
n StepData
n StepDimTol
n StepElement
n StepFEA
n StepGeom
n StepRepr
n StepSelect
n StepShape
n StepToGeom
n StepToTopoDS
n StepVisual
n StlAPI
n StlMesh
n StlTransfer
n TopoDSToStep
n Transfer
n TransferBRep
n UnitsMethods
n Vrml
n VrmlAPI
n VrmlConverter
n VrmlData
n XCAFApp
n XCAFDoc
n XCAFPrs
n XSAlgo
n XSControl
n XmlMXCAFDoc
n XmlXCAFDrivers
r SHMessage
r XSMessage
r XSTEPResource
@ -373,33 +373,33 @@ t TKXDEIGES
t TKXDESTEP
t TKXSBase
t TKXmlXCAF
p BOPTest
p BRepTest
p DBRep
p DDF
p DDataStd
p DDocStd
p DNaming
p DPrsStd
p Draw
p DrawDim
p DrawFairCurve
p DrawTrSurf
p GeometryTest
p GeomliteTest
p HLRTest
p MeshTest
p SWDRAW
p TObjDRAW
p TestTopOpe
p TestTopOpeDraw
p TestTopOpeTools
p ViewerTest
p XDEDRAW
p XSDRAW
p XSDRAWIGES
p XSDRAWSTEP
p XSDRAWSTLVRML
n BOPTest
n BRepTest
n DBRep
n DDF
n DDataStd
n DDocStd
n DNaming
n DPrsStd
n Draw
n DrawDim
n DrawFairCurve
n DrawTrSurf
n GeometryTest
n GeomliteTest
n HLRTest
n MeshTest
n SWDRAW
n TObjDRAW
n TestTopOpe
n TestTopOpeDraw
n TestTopOpeTools
n ViewerTest
n XDEDRAW
n XSDRAW
n XSDRAWIGES
n XSDRAWSTEP
n XSDRAWSTLVRML
r DrawResources
t TKDCAF
t TKDraw
@ -409,22 +409,22 @@ t TKViewerTest
t TKXDEDRAW
t TKXSDRAW
x DRAWEXE
p QADraw
p QANCollection
p QANewBRepNaming
p QANewDBRepNaming
p QANewModTopOpe
n QADraw
n QANCollection
n QANewBRepNaming
n QANewDBRepNaming
n QANewModTopOpe
t TKQADraw
p QADNaming
p QABugs
p Font
p BOPAlgo
p BOPDS
p BOPCol
p IVtk
p IVtkOCC
p IVtkVTK
p IVtkTools
n QADNaming
n QABugs
n Font
n BOPAlgo
n BOPDS
n BOPCol
n IVtk
n IVtkOCC
n IVtkVTK
n IVtkTools
t TKIVtk
p IVtkDraw
n IVtkDraw
t TKIVtkDraw

View File

@ -1,706 +0,0 @@
-- Created on: 1996-12-11
-- Created by: Robert COUBLANC
-- 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.
package AIS
---Purpose: Application Interactive Services provide the means to
-- create links between an application GUI viewer and
-- the packages which are used to manage selection
-- and presentation. The tools AIS defined in order to
-- do this include different sorts of entities: both the
-- selectable viewable objects themselves and the
-- context and attribute managers to define their
-- selection and display.
-- To orient the user as he works in a modeling
-- environment, views and selections must be
-- comprehensible. There must be several different sorts
-- of selectable and viewable object defined. These must
-- also be interactive, that is, connecting graphic
-- representation and the underlying reference
-- geometry. These entities are called Interactive
-- Objects, and are divided into four types:
-- - the Datum
-- - the Relation
-- - the Object
-- - None.
-- The Datum groups together the construction elements
-- such as lines, circles, points, trihedra, plane trihedra,
-- planes and axes.
-- The Relation is made up of constraints on one or
-- more interactive shapes and the corresponding
-- reference geometry. For example, you might want to
-- constrain two edges in a parallel relation. This
-- contraint is considered as an object in its own right,
-- and is shown as a sensitive primitive. This takes the
-- graphic form of a perpendicular arrow marked with
-- the || symbol and lying between the two edges.
-- The Object type includes topological shapes, and
-- connections between shapes.
-- None, in order not to eliminate the object, tells the
-- application to look further until it finds an object
-- definition in its generation which is accepted.
-- Inside these categories, you have the possibility
-- of an additional characterization by means of a
-- signature. The signature provides an index to the
-- further characterization. By default, the Interactive
-- Object has a None type and a signature of 0
-- (equivalent to None.) If you want to give a particular
-- type and signature to your interactive object, you must
-- redefine the two virtual methods: Type and Signature.
-- In the C++ inheritance structure of the package, each
-- class representing a specific Interactive Object
-- inherits AIS_InteractiveObject. Among these
-- inheriting classes, AIS_Relation functions as the
-- abstract mother class for tinheriting classes defining
-- display of specific relational constraints and types of
-- dimension. Some of these include:
-- - display of constraints based on relations of
-- symmetry, tangency, parallelism and concentricity
-- - display of dimensions for angles, offsets,
-- diameters, radii and chamfers.
-- No viewer can show everything at once with any
-- coherence or clarity. Views must be managed
-- carefully both sequentially and at any given instant.
-- Another function of the view is that of a context to
-- carry out design in. The design changes are applied
-- to the objects in the view and then extended to the
-- underlying reference geometry by a solver. To make
-- sense of this complicated visual data, several display
-- and selection tools are required. To facilitate
-- management, each object and each construction
-- element has a selection priority. There are also
-- means to modify the default priority.
-- To define an environment of dynamic detection, you
-- can use standard filter classes or create your own. A
-- filter questions the owner of the sensitive primitive in
-- local context to determine if it has the the desired
-- qualities. If it answers positively, it is kept. If not, it is rejected.
-- The standard filters supplied in AIS include:
-- AIS_AttributeFilter
-- AIS_SignatureFilter
-- AIS_TypeFilter.
-- Only the type filter can be used in the default
-- operating mode, the neutral point. The others can
-- only be used in open local contexts.
-- Neutral point and local context constitute the two
-- operating modes of the central entity which pilots
-- visualizations and selections, the Interactive Context.
-- It is linked to a main viewer and if you like, a trash bin
-- viewer as well.
-- The neutral point, which is the default mode, allows
-- you to easily visualize and select interactive objects
-- which have been loaded into the context. Opening
-- local contexts allows you to prepare and use a
-- temporary selection environment without disturbing
-- the neutral point. A set of functions allows you to
-- choose the interactive objects which you want to act
-- on, the selection modes which you want to activate,
-- and the temporary visualizations which you will
-- execute. When the operation is finished, you close the
-- current local context and return to the state in which
-- you were before opening it (neutral point or previous
-- local context).
-- An interactive object can have a certain number of
-- graphic attributes which are specific to it, such as
-- visualization mode, color, and material. By the same
-- token, the interactive context has a set of graphic
-- attributes, the Drawer which is valid by default for the
-- objects it controls. When an interactive object is
-- visualized, the required graphic attributes are first
-- taken from the object's own Drawer if one exists, or
-- from the context drawer for the others.
uses
TCollection,
MMgt,
Quantity,
TColgp,
TColStd,
TopLoc,
gp,
Geom,
Bnd,
Aspect,
Graphic3d,
V3d,
TopAbs,
TopoDS,
Prs3d,
PrsMgr,
Select3D,
SelectMgr,
StdSelect,
DsgPrs,
TopTools,
Poly,
Image
is
enumeration DisplayMode is WireFrame, Shaded;
---Purpose:
-- Sets display modes other than neutral point ones,
-- for interactive objects. The possibilities include:
-- - wireframe,
-- - shaded,
enumeration ConnectStatus is
CS_None,
CS_Connection,
CS_Transform,
CS_Both;
---Purpose: Gives the status of connection of an Interactive
-- Object. This will be one of the following:
-- - No connection
-- - Connection
-- - Transformation
-- - Both connection and transformation
-- This enumeration is used in
-- AIS_ConnectedInteractive. Transform indicates
-- that the Interactive Object reference geometry has
-- changed location relative to the reference geometry.
enumeration TypeOfIso is
TOI_IsoU,
TOI_IsoV,
TOI_Both;
---Purpose: Declares the type of isoparameter displayed.
enumeration DisplayStatus is
DS_Displayed,
DS_Erased,
DS_Temporary,
DS_None;
---Purpose:
-- To give the display status of an Interactive Object.
-- This will be one of the following:
-- - DS_Displayed: the Interactive Object is
-- displayed in the main viewer;
-- - DS_Erased: the Interactive Object is hidden in main viewer;
-- - DS_Temporary: the Interactive Object is temporarily displayed;
-- - DS_None: the Interactive Object is nowhere displayed.
enumeration SelectStatus is
SS_Added,
SS_Removed,
SS_NotDone
end SelectStatus;
enumeration StatusOfPick is
SOP_Error,
SOP_NothingSelected,
SOP_Removed,
SOP_OneSelected,
SOP_SeveralSelected
end StatusOfPick;
enumeration StatusOfDetection is
SOD_Error,
SOD_Nothing,
SOD_AllBad,
SOD_Selected,
SOD_OnlyOneDetected,
SOD_OnlyOneGood,
SOD_SeveralGood
end StatusOfDetection;
enumeration KindOfDimension is
KOD_NONE,
KOD_LENGTH,
KOD_PLANEANGLE,
KOD_SOLIDANGLE,
KOD_AREA,
KOD_VOLUME,
KOD_MASS,
KOD_TIME,
KOD_RADIUS,
KOD_DIAMETER,
KOD_CHAMF2D,
KOD_CHAMF3D,
KOD_OFFSET,
KOD_ELLIPSERADIUS;
---Purpose: Declares the kinds of dimensions needed in the
-- display of Interactive Objects.
enumeration KindOfInteractive is
KOI_None,
KOI_Datum,
KOI_Shape,
KOI_Object,
KOI_Relation,
KOI_Dimension;
--- Purpose: Declares the type of Interactive Object.
-- This is one of the following:
-- - the Datum
-- - the Object
-- - the Relation
-- - the Dimension
-- - the None type.
-- The Datum is the construction element. These include
-- points, lines, axes and planes. The object brings
-- together topological shapes. The Relation includes
-- dimensions and constraints. The Dimension includes
-- length, radius, diameter and angle dimensions.
-- When the object is of an unknown type, the None
-- type is declared.
enumeration ClearMode is
CM_All,
CM_Interactive,
CM_Filters,
CM_StandardModes,
CM_TemporaryShapePrs
end ClearMode;
---Purpose: Declares which entities in an opened local context
-- are to be cleared of mode settings. Temporary
-- graphic presentations such as those for sub-shapes,
-- for example, are only created for the selection
-- process. By means of these enumerations, they can
-- be cleared from local context.
enumeration KindOfUnit is
TOU_LENGTH,
TOU_SURFACE,
TOU_VOLUME,
TOU_PLANE_ANGLE,
TOU_SOLID_ANGLE,
TOU_MASS,
TOU_FORCE,
TOU_TIME;
---Purpose: Declares the type of Interactive Object unit.
enumeration TypeOfAxis is TOAX_Unknown,TOAX_XAxis,TOAX_YAxis,TOAX_ZAxis;
---Purpose: Declares the type of axis.
enumeration TypeOfPlane is TOPL_Unknown,TOPL_XYPlane,TOPL_XZPlane,TOPL_YZPlane;
---Purpose: Declares the type of plane.
enumeration TypeOfDist is TOD_Unknown,TOD_Horizontal,TOD_Vertical;
---Purpose: To declare the type of distance.
enumeration TypeOfAttribute is
TOA_Line,
TOA_Dimension,
TOA_Wire,
TOA_Plane,
TOA_Vector,
TOA_UIso,
TOA_VIso,
TOA_Free,
TOA_UnFree,
TOA_Section,
TOA_Hidden,
TOA_Seen,
TOA_FirstAxis,
TOA_SecondAxis,
TOA_ThirdAxis;
enumeration StandardDatum is SD_None,SD_Point,SD_Axis,SD_Trihedron,SD_PlaneTrihedron,SD_Line,SD_Circle,SD_Plane;
--- Purpose: Declares the type of standard datum of an Interactive Object.
enumeration KindOfSurface is KOS_Plane, KOS_Cylinder, KOS_Cone, KOS_Sphere, KOS_Torus,
KOS_Revolution, KOS_Extrusion, KOS_OtherSurface;
-- Enumerations for dimensions management --
enumeration DisplaySpecialSymbol is DSS_No, DSS_Before, DSS_After;
---Purpose: Specifies dimension special symbol display options
enumeration DimensionSelectionMode is DSM_All, DSM_Line, DSM_Text;
---Purpose: Specifies dimension selection modes.
class Triangulation;
imported ColoredShape;
imported TexturedShape;
class InteractiveContext;
class GraphicTool;
class LocalContext;
class LocalStatus;
class GlobalStatus;
deferred class InteractiveObject;
---Category: VARIOUS STANDARD INTERACTIVE OBJECTS
-- each type of Datum has a given signature.
-- the other interactive objects don't
-- implement this signature.
-- Mainly used for selection with Filters...
---Category: Datum
class Point; --signature 1
class Axis; --signature 2
class Trihedron; --signature 3
class PlaneTrihedron; --signature 4
class Line; --signature 5
class Circle; --signature 6
class Plane; --signature 7
---Category: Object of type Shape
class Shape; --signature 0
---Category: General Objects
class ConnectedInteractive; --signature 0
class MultipleConnectedInteractive; --signature 1
imported PointCloud;
---Category: DIMENSIONS AND RELATIONS
class DimensionOwner;
deferred class Relation;
deferred class EllipseRadiusDimension;
class MaxRadiusDimension;
class MinRadiusDimension;
imported LengthDimension;
imported AngleDimension;
imported RadiusDimension;
imported DiameterDimension;
class Chamf2dDimension;
class Chamf3dDimension;
class OffsetDimension;
class FixRelation;
class PerpendicularRelation;
class ParallelRelation;
class TangentRelation;
class ConcentricRelation;
class IdenticRelation;
class SymmetricRelation; -- axial symmetry
class MidPointRelation; -- equal distance from point
class EqualRadiusRelation;
class EqualDistanceRelation;
---Category: FILTERS
class TypeFilter;
class SignatureFilter;
class ExclusionFilter;
class AttributeFilter;
class C0RegularityFilter;
class BadEdgeFilter;
pointer PToContext to InteractiveContext from AIS;
class Selection;
---Category: The Collections
imported ListOfInteractive;
imported ListIteratorOfListOfInteractive;
imported SequenceOfInteractive;
imported SequenceOfDimension;
imported MapOfInteractive;
imported MapIteratorOfMapOfInteractive;
imported DataMapofIntegerListOfinteractive;
imported DataMapIteratorOfDataMapofIntegerListOfinteractive;
-- for further management of layers
imported DataMapOfIOStatus;
imported DataMapIteratorOfDataMapOfIOStatus;
-- Management of interactiveObjects Status...
imported IndexedDataMapOfOwnerPrs;
-- for dynamic selection management in local context...
-- san: 18/04/2003 AIS_Selection class optimization
-- agv: 04/05/2003 Replace NCollection_List for CDL list
imported NListTransient;
imported NListIteratorOfListTransient;
imported NDataMapOfTransientIteratorOfListTransient;
-- service map for AIS_Selection class optimized logic
imported DataMapOfILC;
imported DataMapIteratorOfDataMapOfILC;
imported DataMapOfSelStat;
imported DataMapIteratorOfDataMapOfSelStat;
-- to tell if an object is sensitive to Standard Modes Of Selection....
-- Methods for dimensions
Nearest( aShape : Shape from TopoDS;
aPoint : Pnt from gp )
returns Pnt from gp;
---Purpose:
-- Returns the nearest point in a shape. This is used by
-- several classes in calculation of dimensions.
Nearest (theLine : Lin from gp;
thePoint : Pnt from gp)
returns Pnt from gp;
---Purpose:
-- @return the nearest point on the line.
Nearest (theCurve : Curve from Geom;
thePoint : Pnt from gp;
theFirstPoint : Pnt from gp;
theLastPoint : Pnt from gp;
theNearestPoint : out Pnt from gp)
returns Boolean from Standard;
---Purpose:
-- For the given point finds nearest point on the curve,
-- @return TRUE if found point is belongs to the curve
-- and FALSE otherwise.
Farest( aShape : Shape from TopoDS;
aPoint : Pnt from gp )
returns Pnt from gp;
ComputeGeometry (theEdge : Edge from TopoDS;
theCurve : out Curve from Geom;
theFirstPnt : out Pnt from gp;
theLastPnt : out Pnt from gp)
---Purpose: Used by 2d Relation only
-- Computes the 3d geometry of <anEdge> in the current WorkingPlane
-- and the extremities if any
-- Return TRUE if ok.
returns Boolean from Standard;
ComputeGeometry (theEdge : Edge from TopoDS;
theCurve : out Curve from Geom;
theFirstPnt : out Pnt from gp;
theLastPnt : out Pnt from gp;
theIsInfinite : out Boolean from Standard)
---Purpose: Used by dimensions only.
-- Computes the 3d geometry of <anEdge>.
-- Return TRUE if ok.
returns Boolean from Standard;
ComputeGeometry (theEdge : Edge from TopoDS;
theCurve : out Curve from Geom;
theFirstPnt : out Pnt from gp;
theLastPnt : out Pnt from gp;
theExtCurve : out Curve from Geom;
theIsInfinite : out Boolean from Standard;
theIsOnPlane : out Boolean from Standard;
thePlane : Plane from Geom)
---Purpose: Used by 2d Relation only
-- Computes the 3d geometry of <anEdge> in the current WorkingPlane
-- and the extremities if any.
-- If <aCurve> is not in the current plane, <extCurve> contains
-- the not projected curve associated to <anEdge>.
-- If <anEdge> is infinite, <isinfinite> = true and the 2
-- parameters <FirstPnt> and <LastPnt> have no signification.
-- Return TRUE if ok.
returns Boolean from Standard;
ComputeGeometry (theFirstEdge : Edge from TopoDS;
theSecondEdge : Edge from TopoDS;
theFirstCurve : out Curve from Geom;
theSecondCurve : out Curve from Geom;
theFirstPnt1 : out Pnt from gp;
theLastPnt1 : out Pnt from gp;
theFirstPnt2 : out Pnt from gp;
theLastPnt2 : out Pnt from gp;
thePlane : Plane from Geom)
---Purpose: Used by 2d Relation only
-- Computes the 3d geometry of <anEdge> in the current WorkingPlane
-- and the extremities if any
-- Return TRUE if ok.
returns Boolean from Standard;
ComputeGeometry (theFirstEdge : Edge from TopoDS;
theSecondEdge : Edge from TopoDS;
theFirstCurve : out Curve from Geom;
theSecondCurve : out Curve from Geom;
theFirstPnt1 : out Pnt from gp;
theLastPnt1 : out Pnt from gp;
theFirstPnt2 : out Pnt from gp;
theLastPnt2 : out Pnt from gp;
theIsinfinite1 : out Boolean from Standard;
theIsinfinite2 : out Boolean from Standard)
---Purpose: Used by dimensions only.Computes the 3d geometry
-- of<anEdge1> and <anEdge2> and checks if they are infinite.
returns Boolean from Standard;
ComputeGeometry (theFirstEdge : Edge from TopoDS;
theSecondEdge : Edge from TopoDS;
theExtIndex : out Integer from Standard;
theFirstCurve : out Curve from Geom;
theSecondCurve : out Curve from Geom;
theFirstPnt1 : out Pnt from gp;
theLastPnt1 : out Pnt from gp;
theFirstPnt2 : out Pnt from gp;
theLastPnt2 : out Pnt from gp;
theExtCurve : out Curve from Geom;
theIsinfinite1 : out Boolean from Standard;
theIsinfinite2 : out Boolean from Standard;
thePlane : Plane from Geom)
---Purpose: Used by 2d Relation only Computes the 3d geometry
-- of<anEdge1> and <anEdge2> in the current Plane and the
-- extremities if any. Return in ExtCurve the 3d curve
-- (not projected in the plane) of the first edge if
-- <indexExt> =1 or of the 2nd edge if <indexExt> = 2. If
-- <indexExt> = 0, ExtCurve is Null. if there is an edge
-- external to the plane, <isinfinite> is true if this
-- edge is infinite. So, the extremities of it are not
-- significant. Return TRUE if ok
returns Boolean from Standard;
ComputeGeomCurve (aCurve : in out Curve from Geom;
first1 : Real from Standard;
last1 : Real from Standard;
FirstPnt1 : out Pnt from gp;
LastPnt1 : out Pnt from gp;
aPlane : Plane from Geom;
isOnPlane: out Boolean from Standard)
---Purpose: Checks if aCurve belongs to aPlane; if not, projects aCurve in aPlane
-- and returns aCurve;
-- Return TRUE if ok
returns Boolean from Standard;
ComputeGeometry (aVertex : Vertex from TopoDS;
point : out Pnt from gp;
aPlane : Plane from Geom;
isOnPlane: out Boolean from Standard)
returns Boolean from Standard;
GetPlaneFromFace (aFace : Face from TopoDS;
aPlane : out Pln from gp;
aSurf : out Surface from Geom;
aSurfType : out KindOfSurface from AIS;
Offset : out Real from Standard)
returns Boolean from Standard;
---Purpose: Tryes to get Plane from Face. Returns Surface of Face
-- in aSurf. Returns Standard_True and Plane of Face in
-- aPlane in following cases:
-- Face is Plane, Offset of Plane,
-- Extrusion of Line and Offset of Extrusion of Line
-- Returns pure type of Surface which can be:
-- Plane, Cylinder, Cone, Sphere, Torus,
-- SurfaceOfRevolution, SurfaceOfExtrusion
InitFaceLength (aFace : Face from TopoDS;
aPlane : out Pln from gp;
aSurface : out Surface from Geom;
aSurfaceType : out KindOfSurface from AIS;
anOffset : out Real from Standard );
InitLengthBetweenCurvilinearFaces (theFirstFace : Face from TopoDS;
theSecondFace : Face from TopoDS;
theFirstSurf : in out Surface from Geom;
theSecondSurf : in out Surface from Geom;
theFirstAttach : out Pnt from gp;
theSecondAttach : out Pnt from gp;
theDirOnPlane : out Dir from gp);
---Purpose: Finds attachment points on two curvilinear faces for length dimension.
-- @param thePlaneDir [in] the direction on the dimension plane to
-- compute the plane automatically. It will not be taken into account if
-- plane is defined by user.
InitAngleBetweenPlanarFaces (theFirstFace : Face from TopoDS;
theSecondFace : Face from TopoDS;
theCenter : out Pnt from gp;
theFirstAttach : out Pnt from gp;
theSecondAttach : out Pnt from gp;
theIsFirstPointSet : Boolean from Standard = Standard_False)
returns Boolean from Standard;
---Purpose: Finds three points for the angle dimension between
-- two planes.
InitAngleBetweenCurvilinearFaces (theFirstFace : Face from TopoDS;
theSecondFace : Face from TopoDS;
theFirstSurfType : KindOfSurface from AIS;
theSecondSurfType : KindOfSurface from AIS;
theCenter : out Pnt from gp;
theFirstAttach : out Pnt from gp;
theSecondAttach : out Pnt from gp;
theIsFirstPointSet : Boolean from Standard = Standard_False)
returns Boolean from Standard;
---Purpose: Finds three points for the angle dimension between
-- two curvilinear surfaces.
ProjectPointOnPlane( aPoint : Pnt from gp; aPlane : Pln from gp )
returns Pnt from gp;
ProjectPointOnLine( aPoint : Pnt from gp; aLine : Lin from gp )
returns Pnt from gp;
TranslatePointToBound( aPoint : Pnt from gp; aDir : Dir from gp; aBndBox: Box from Bnd )
returns Pnt from gp;
InDomain( aFirstPar : Real from Standard;
aLastPar : Real from Standard;
anAttachPar : Real from Standard)
returns Boolean from Standard;
---Purpose: returns True if point with anAttachPar is
-- in domain of arc
NearestApex(elips : Elips from gp;
pApex : Pnt from gp;
nApex : Pnt from gp;
fpara : Real from Standard ;
lpara : Real from Standard ;
IsInDomain : out Boolean from Standard)
returns Pnt from gp;
---Purpose: computes nearest to ellipse arc apex
DistanceFromApex(elips : Elips from gp;
Apex : Pnt from gp;
par : Real from Standard )
returns Real from Standard;
---Purpose: computes length of ellipse arc in parametric units
ComputeProjEdgePresentation(aPres : Presentation from Prs3d;
aDrawer : Drawer from Prs3d;
anEdge : Edge from TopoDS;
ProjCurve: Curve from Geom;
FirstP : Pnt from gp;
LastP : Pnt from gp;
aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE;
aWidth : Real from Standard = 2;
aProjTOL : TypeOfLine from Aspect = Aspect_TOL_DASH;
aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT);
ComputeProjVertexPresentation(aPres : Presentation from Prs3d;
aDrawer : Drawer from Prs3d;
aVertex : Vertex from TopoDS;
ProjPoint: Pnt from gp;
aColor : NameOfColor from Quantity = Quantity_NOC_PURPLE;
aWidth : Real from Standard = 2;
aProjTOM : TypeOfMarker from Aspect = Aspect_TOM_PLUS;
aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT);
end AIS;

View File

@ -14,35 +14,25 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS.ixx>
#include <Adaptor3d_HCurve.hxx>
#include <Adaptor3d_HSurface.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <AIS.hxx>
#include <Bnd_Box.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_HSurface.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepTopAdaptor_FClass2d.hxx>
#include <BRep_Tool.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepTools.hxx>
#include <Bnd_Box.hxx>
#include <BRepTopAdaptor_FClass2d.hxx>
#include <ElCLib.hxx>
#include <ElSLib.hxx>
#include <GccEnt_QualifiedLin.hxx>
#include <gce_MakeDir.hxx>
#include <gce_MakeLin.hxx>
#include <Geom2d_Circle.hxx>
#include <GeomAPI_ExtremaCurveCurve.hxx>
#include <GeomAPI_IntSS.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <GeomLib.hxx>
#include <GeomProjLib.hxx>
#include <GeomProjLib.hxx>
#include <Geom_CartesianPoint.hxx>
#include <Geom_Circle.hxx>
#include <Geom_ConicalSurface.hxx>
@ -53,10 +43,17 @@
#include <Geom_OffsetSurface.hxx>
#include <Geom_Plane.hxx>
#include <Geom_SphericalSurface.hxx>
#include <Geom_Surface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_ToroidalSurface.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <GeomAPI_ExtremaCurveCurve.hxx>
#include <GeomAPI_IntSS.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <GeomLib.hxx>
#include <GeomProjLib.hxx>
#include <gp_Ax1.hxx>
#include <gp_Ax3.hxx>
#include <gp_Dir.hxx>
@ -69,15 +66,19 @@
#include <Precision.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <StdPrs_Point.hxx>
#include <StdPrs_WFDeflectionShape.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array2OfReal.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopoDS.hxx>
#include <Geom_Surface.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
const Standard_Real SquareTolerance = Precision::SquareConfusion();

380
src/AIS/AIS.hxx Normal file
View File

@ -0,0 +1,380 @@
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// 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 _AIS_HeaderFile
#define _AIS_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Real.hxx>
#include <AIS_KindOfSurface.hxx>
#include <Prs3d_Drawer.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
class gp_Pnt;
class TopoDS_Shape;
class gp_Lin;
class Geom_Curve;
class TopoDS_Edge;
class Geom_Plane;
class TopoDS_Vertex;
class TopoDS_Face;
class gp_Pln;
class Geom_Surface;
class gp_Dir;
class Bnd_Box;
class gp_Elips;
class Prs3d_Presentation;
class AIS_Triangulation;
class AIS_InteractiveContext;
class AIS_GraphicTool;
class AIS_LocalContext;
class AIS_LocalStatus;
class AIS_GlobalStatus;
class AIS_InteractiveObject;
class AIS_Point;
class AIS_Axis;
class AIS_Trihedron;
class AIS_PlaneTrihedron;
class AIS_Line;
class AIS_Circle;
class AIS_Plane;
class AIS_Shape;
class AIS_ConnectedInteractive;
class AIS_MultipleConnectedInteractive;
class AIS_DimensionOwner;
class AIS_Relation;
class AIS_EllipseRadiusDimension;
class AIS_MaxRadiusDimension;
class AIS_MinRadiusDimension;
class AIS_Chamf2dDimension;
class AIS_Chamf3dDimension;
class AIS_OffsetDimension;
class AIS_FixRelation;
class AIS_PerpendicularRelation;
class AIS_ParallelRelation;
class AIS_TangentRelation;
class AIS_ConcentricRelation;
class AIS_IdenticRelation;
class AIS_SymmetricRelation;
class AIS_MidPointRelation;
class AIS_EqualRadiusRelation;
class AIS_EqualDistanceRelation;
class AIS_TypeFilter;
class AIS_SignatureFilter;
class AIS_ExclusionFilter;
class AIS_AttributeFilter;
class AIS_C0RegularityFilter;
class AIS_BadEdgeFilter;
class AIS_Selection;
//! Application Interactive Services provide the means to
//! create links between an application GUI viewer and
//! the packages which are used to manage selection
//! and presentation. The tools AIS defined in order to
//! do this include different sorts of entities: both the
//! selectable viewable objects themselves and the
//! context and attribute managers to define their
//! selection and display.
//! To orient the user as he works in a modeling
//! environment, views and selections must be
//! comprehensible. There must be several different sorts
//! of selectable and viewable object defined. These must
//! also be interactive, that is, connecting graphic
//! representation and the underlying reference
//! geometry. These entities are called Interactive
//! Objects, and are divided into four types:
//! - the Datum
//! - the Relation
//! - the Object
//! - None.
//! The Datum groups together the construction elements
//! such as lines, circles, points, trihedra, plane trihedra,
//! planes and axes.
//! The Relation is made up of constraints on one or
//! more interactive shapes and the corresponding
//! reference geometry. For example, you might want to
//! constrain two edges in a parallel relation. This
//! contraint is considered as an object in its own right,
//! and is shown as a sensitive primitive. This takes the
//! graphic form of a perpendicular arrow marked with
//! the || symbol and lying between the two edges.
//! The Object type includes topological shapes, and
//! connections between shapes.
//! None, in order not to eliminate the object, tells the
//! application to look further until it finds an object
//! definition in its generation which is accepted.
//! Inside these categories, you have the possibility
//! of an additional characterization by means of a
//! signature. The signature provides an index to the
//! further characterization. By default, the Interactive
//! Object has a None type and a signature of 0
//! (equivalent to None.) If you want to give a particular
//! type and signature to your interactive object, you must
//! redefine the two virtual methods: Type and Signature.
//! In the C++ inheritance structure of the package, each
//! class representing a specific Interactive Object
//! inherits AIS_InteractiveObject. Among these
//! inheriting classes, AIS_Relation functions as the
//! abstract mother class for tinheriting classes defining
//! display of specific relational constraints and types of
//! dimension. Some of these include:
//! - display of constraints based on relations of
//! symmetry, tangency, parallelism and concentricity
//! - display of dimensions for angles, offsets,
//! diameters, radii and chamfers.
//! No viewer can show everything at once with any
//! coherence or clarity. Views must be managed
//! carefully both sequentially and at any given instant.
//! Another function of the view is that of a context to
//! carry out design in. The design changes are applied
//! to the objects in the view and then extended to the
//! underlying reference geometry by a solver. To make
//! sense of this complicated visual data, several display
//! and selection tools are required. To facilitate
//! management, each object and each construction
//! element has a selection priority. There are also
//! means to modify the default priority.
//! To define an environment of dynamic detection, you
//! can use standard filter classes or create your own. A
//! filter questions the owner of the sensitive primitive in
//! local context to determine if it has the the desired
//! qualities. If it answers positively, it is kept. If not, it is rejected.
//! The standard filters supplied in AIS include:
//! AIS_AttributeFilter
//! AIS_SignatureFilter
//! AIS_TypeFilter.
//! Only the type filter can be used in the default
//! operating mode, the neutral point. The others can
//! only be used in open local contexts.
//! Neutral point and local context constitute the two
//! operating modes of the central entity which pilots
//! visualizations and selections, the Interactive Context.
//! It is linked to a main viewer and if you like, a trash bin
//! viewer as well.
//! The neutral point, which is the default mode, allows
//! you to easily visualize and select interactive objects
//! which have been loaded into the context. Opening
//! local contexts allows you to prepare and use a
//! temporary selection environment without disturbing
//! the neutral point. A set of functions allows you to
//! choose the interactive objects which you want to act
//! on, the selection modes which you want to activate,
//! and the temporary visualizations which you will
//! execute. When the operation is finished, you close the
//! current local context and return to the state in which
//! you were before opening it (neutral point or previous
//! local context).
//! An interactive object can have a certain number of
//! graphic attributes which are specific to it, such as
//! visualization mode, color, and material. By the same
//! token, the interactive context has a set of graphic
//! attributes, the Drawer which is valid by default for the
//! objects it controls. When an interactive object is
//! visualized, the required graphic attributes are first
//! taken from the object's own Drawer if one exists, or
//! from the context drawer for the others.
class AIS
{
public:
DEFINE_STANDARD_ALLOC
//! Returns the nearest point in a shape. This is used by
//! several classes in calculation of dimensions.
Standard_EXPORT static gp_Pnt Nearest (const TopoDS_Shape& aShape, const gp_Pnt& aPoint);
//! @return the nearest point on the line.
Standard_EXPORT static gp_Pnt Nearest (const gp_Lin& theLine, const gp_Pnt& thePoint);
//! For the given point finds nearest point on the curve,
//! @return TRUE if found point is belongs to the curve
//! and FALSE otherwise.
Standard_EXPORT static Standard_Boolean Nearest (const Handle(Geom_Curve)& theCurve, const gp_Pnt& thePoint, const gp_Pnt& theFirstPoint, const gp_Pnt& theLastPoint, gp_Pnt& theNearestPoint);
Standard_EXPORT static gp_Pnt Farest (const TopoDS_Shape& aShape, const gp_Pnt& aPoint);
//! Used by 2d Relation only
//! Computes the 3d geometry of <anEdge> in the current WorkingPlane
//! and the extremities if any
//! Return TRUE if ok.
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theEdge, Handle(Geom_Curve)& theCurve, gp_Pnt& theFirstPnt, gp_Pnt& theLastPnt);
//! Used by dimensions only.
//! Computes the 3d geometry of <anEdge>.
//! Return TRUE if ok.
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theEdge, Handle(Geom_Curve)& theCurve, gp_Pnt& theFirstPnt, gp_Pnt& theLastPnt, Standard_Boolean& theIsInfinite);
//! Used by 2d Relation only
//! Computes the 3d geometry of <anEdge> in the current WorkingPlane
//! and the extremities if any.
//! If <aCurve> is not in the current plane, <extCurve> contains
//! the not projected curve associated to <anEdge>.
//! If <anEdge> is infinite, <isinfinite> = true and the 2
//! parameters <FirstPnt> and <LastPnt> have no signification.
//! Return TRUE if ok.
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theEdge, Handle(Geom_Curve)& theCurve, gp_Pnt& theFirstPnt, gp_Pnt& theLastPnt, Handle(Geom_Curve)& theExtCurve, Standard_Boolean& theIsInfinite, Standard_Boolean& theIsOnPlane, const Handle(Geom_Plane)& thePlane);
//! Used by 2d Relation only
//! Computes the 3d geometry of <anEdge> in the current WorkingPlane
//! and the extremities if any
//! Return TRUE if ok.
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theFirstEdge, const TopoDS_Edge& theSecondEdge, Handle(Geom_Curve)& theFirstCurve, Handle(Geom_Curve)& theSecondCurve, gp_Pnt& theFirstPnt1, gp_Pnt& theLastPnt1, gp_Pnt& theFirstPnt2, gp_Pnt& theLastPnt2, const Handle(Geom_Plane)& thePlane);
//! Used by dimensions only.Computes the 3d geometry
//! of<anEdge1> and <anEdge2> and checks if they are infinite.
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theFirstEdge, const TopoDS_Edge& theSecondEdge, Handle(Geom_Curve)& theFirstCurve, Handle(Geom_Curve)& theSecondCurve, gp_Pnt& theFirstPnt1, gp_Pnt& theLastPnt1, gp_Pnt& theFirstPnt2, gp_Pnt& theLastPnt2, Standard_Boolean& theIsinfinite1, Standard_Boolean& theIsinfinite2);
//! Used by 2d Relation only Computes the 3d geometry
//! of<anEdge1> and <anEdge2> in the current Plane and the
//! extremities if any. Return in ExtCurve the 3d curve
//! (not projected in the plane) of the first edge if
//! <indexExt> =1 or of the 2nd edge if <indexExt> = 2. If
//! <indexExt> = 0, ExtCurve is Null. if there is an edge
//! external to the plane, <isinfinite> is true if this
//! edge is infinite. So, the extremities of it are not
//! significant. Return TRUE if ok
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theFirstEdge, const TopoDS_Edge& theSecondEdge, Standard_Integer& theExtIndex, Handle(Geom_Curve)& theFirstCurve, Handle(Geom_Curve)& theSecondCurve, gp_Pnt& theFirstPnt1, gp_Pnt& theLastPnt1, gp_Pnt& theFirstPnt2, gp_Pnt& theLastPnt2, Handle(Geom_Curve)& theExtCurve, Standard_Boolean& theIsinfinite1, Standard_Boolean& theIsinfinite2, const Handle(Geom_Plane)& thePlane);
//! Checks if aCurve belongs to aPlane; if not, projects aCurve in aPlane
//! and returns aCurve;
//! Return TRUE if ok
Standard_EXPORT static Standard_Boolean ComputeGeomCurve (Handle(Geom_Curve)& aCurve, const Standard_Real first1, const Standard_Real last1, gp_Pnt& FirstPnt1, gp_Pnt& LastPnt1, const Handle(Geom_Plane)& aPlane, Standard_Boolean& isOnPlane);
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Vertex& aVertex, gp_Pnt& point, const Handle(Geom_Plane)& aPlane, Standard_Boolean& isOnPlane);
//! Tryes to get Plane from Face. Returns Surface of Face
//! in aSurf. Returns Standard_True and Plane of Face in
//! aPlane in following cases:
//! Face is Plane, Offset of Plane,
//! Extrusion of Line and Offset of Extrusion of Line
//! Returns pure type of Surface which can be:
//! Plane, Cylinder, Cone, Sphere, Torus,
//! SurfaceOfRevolution, SurfaceOfExtrusion
Standard_EXPORT static Standard_Boolean GetPlaneFromFace (const TopoDS_Face& aFace, gp_Pln& aPlane, Handle(Geom_Surface)& aSurf, AIS_KindOfSurface& aSurfType, Standard_Real& Offset);
Standard_EXPORT static void InitFaceLength (const TopoDS_Face& aFace, gp_Pln& aPlane, Handle(Geom_Surface)& aSurface, AIS_KindOfSurface& aSurfaceType, Standard_Real& anOffset);
//! Finds attachment points on two curvilinear faces for length dimension.
//! @param thePlaneDir [in] the direction on the dimension plane to
//! compute the plane automatically. It will not be taken into account if
//! plane is defined by user.
Standard_EXPORT static void InitLengthBetweenCurvilinearFaces (const TopoDS_Face& theFirstFace, const TopoDS_Face& theSecondFace, Handle(Geom_Surface)& theFirstSurf, Handle(Geom_Surface)& theSecondSurf, gp_Pnt& theFirstAttach, gp_Pnt& theSecondAttach, gp_Dir& theDirOnPlane);
//! Finds three points for the angle dimension between
//! two planes.
Standard_EXPORT static Standard_Boolean InitAngleBetweenPlanarFaces (const TopoDS_Face& theFirstFace, const TopoDS_Face& theSecondFace, gp_Pnt& theCenter, gp_Pnt& theFirstAttach, gp_Pnt& theSecondAttach, const Standard_Boolean theIsFirstPointSet = Standard_False);
//! Finds three points for the angle dimension between
//! two curvilinear surfaces.
Standard_EXPORT static Standard_Boolean InitAngleBetweenCurvilinearFaces (const TopoDS_Face& theFirstFace, const TopoDS_Face& theSecondFace, const AIS_KindOfSurface theFirstSurfType, const AIS_KindOfSurface theSecondSurfType, gp_Pnt& theCenter, gp_Pnt& theFirstAttach, gp_Pnt& theSecondAttach, const Standard_Boolean theIsFirstPointSet = Standard_False);
Standard_EXPORT static gp_Pnt ProjectPointOnPlane (const gp_Pnt& aPoint, const gp_Pln& aPlane);
Standard_EXPORT static gp_Pnt ProjectPointOnLine (const gp_Pnt& aPoint, const gp_Lin& aLine);
Standard_EXPORT static gp_Pnt TranslatePointToBound (const gp_Pnt& aPoint, const gp_Dir& aDir, const Bnd_Box& aBndBox);
//! returns True if point with anAttachPar is
//! in domain of arc
Standard_EXPORT static Standard_Boolean InDomain (const Standard_Real aFirstPar, const Standard_Real aLastPar, const Standard_Real anAttachPar);
//! computes nearest to ellipse arc apex
Standard_EXPORT static gp_Pnt NearestApex (const gp_Elips& elips, const gp_Pnt& pApex, const gp_Pnt& nApex, const Standard_Real fpara, const Standard_Real lpara, Standard_Boolean& IsInDomain);
//! computes length of ellipse arc in parametric units
Standard_EXPORT static Standard_Real DistanceFromApex (const gp_Elips& elips, const gp_Pnt& Apex, const Standard_Real par);
Standard_EXPORT static void ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPres, const Handle(Prs3d_Drawer)& aDrawer, const TopoDS_Edge& anEdge, const Handle(Geom_Curve)& ProjCurve, const gp_Pnt& FirstP, const gp_Pnt& LastP, const Quantity_NameOfColor aColor = Quantity_NOC_PURPLE, const Standard_Real aWidth = 2, const Aspect_TypeOfLine aProjTOL = Aspect_TOL_DASH, const Aspect_TypeOfLine aCallTOL = Aspect_TOL_DOT);
Standard_EXPORT static void ComputeProjVertexPresentation (const Handle(Prs3d_Presentation)& aPres, const Handle(Prs3d_Drawer)& aDrawer, const TopoDS_Vertex& aVertex, const gp_Pnt& ProjPoint, const Quantity_NameOfColor aColor = Quantity_NOC_PURPLE, const Standard_Real aWidth = 2, const Aspect_TypeOfMarker aProjTOM = Aspect_TOM_PLUS, const Aspect_TypeOfLine aCallTOL = Aspect_TOL_DOT);
protected:
private:
friend class AIS_Triangulation;
friend class AIS_InteractiveContext;
friend class AIS_GraphicTool;
friend class AIS_LocalContext;
friend class AIS_LocalStatus;
friend class AIS_GlobalStatus;
friend class AIS_InteractiveObject;
friend class AIS_Point;
friend class AIS_Axis;
friend class AIS_Trihedron;
friend class AIS_PlaneTrihedron;
friend class AIS_Line;
friend class AIS_Circle;
friend class AIS_Plane;
friend class AIS_Shape;
friend class AIS_ConnectedInteractive;
friend class AIS_MultipleConnectedInteractive;
friend class AIS_DimensionOwner;
friend class AIS_Relation;
friend class AIS_EllipseRadiusDimension;
friend class AIS_MaxRadiusDimension;
friend class AIS_MinRadiusDimension;
friend class AIS_Chamf2dDimension;
friend class AIS_Chamf3dDimension;
friend class AIS_OffsetDimension;
friend class AIS_FixRelation;
friend class AIS_PerpendicularRelation;
friend class AIS_ParallelRelation;
friend class AIS_TangentRelation;
friend class AIS_ConcentricRelation;
friend class AIS_IdenticRelation;
friend class AIS_SymmetricRelation;
friend class AIS_MidPointRelation;
friend class AIS_EqualRadiusRelation;
friend class AIS_EqualDistanceRelation;
friend class AIS_TypeFilter;
friend class AIS_SignatureFilter;
friend class AIS_ExclusionFilter;
friend class AIS_AttributeFilter;
friend class AIS_C0RegularityFilter;
friend class AIS_BadEdgeFilter;
friend class AIS_Selection;
};
#endif // _AIS_HeaderFile

View File

@ -1,104 +0,0 @@
-- Created on: 1997-03-04
-- Created by: Robert COUBLANC
-- 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 AttributeFilter from AIS inherits Filter from SelectMgr
---Purpose: Selects Interactive Objects, which have the desired width or color.
-- The filter questions each Interactive Object in local
-- context to determine whether it has an non-null
-- owner, and if so, whether it has the required color
-- and width attributes. If the object returns true in each
-- case, it is kept. If not, it is rejected.
-- This filter is used only in an open local context.
-- In the Collector viewer, you can only locate
-- Interactive Objects, which answer positively to the
-- filters, which are in position when a local context is open.
uses
NameOfColor from Quantity,
EntityOwner from SelectMgr
is
Create returns AttributeFilter from AIS;
---Purpose:
-- Constructs an empty attribute filter object.
-- This filter object determines whether selectable
-- interactive objects have a non-null owner.
Create (aCol: NameOfColor from Quantity)
returns AttributeFilter from AIS;
---Purpose:
-- Constructs an attribute filter object defined by the
-- color attribute aCol.
Create (aWidth : Real from Standard)
returns AttributeFilter from AIS;
---Purpose:
-- Constructs an attribute filter object defined by the line
-- width attribute aWidth.
HasColor(me) returns Boolean from Standard;
---C++: inline
---Purpose:
-- Indicates that the Interactive Object has the color
-- setting specified by the argument aCol at construction time.
HasWidth(me) returns Boolean from Standard;
---C++: inline
---Purpose:
-- Indicates that the Interactive Object has the width
-- setting specified by the argument aWidth at
-- construction time.
SetColor(me:mutable;aCol: NameOfColor from Quantity);
---C++: inline
---Purpose: Sets the color aCol.
-- This must be chosen from the list of colors in Quantity_NameOfColor.
SetWidth(me:mutable;aWidth : Real from Standard);
---C++: inline
---Purpose: Sets the line width aWidth.
UnsetColor(me:mutable);
---C++: inline
---Purpose:
-- Removes the setting for color from the filter.
UnsetWidth(me:mutable);
---C++: inline
---Purpose:
-- Removes the setting for width from the filter.
IsOk(me;anObj : EntityOwner from SelectMgr)
returns Boolean from Standard is redefined virtual;
---Purpose: Indicates that the selected Interactive Object passes
-- the filter. The owner, anObj, can be either direct or
-- user. A direct owner is the corresponding
-- construction element, whereas a user is the
-- compound shape of which the entity forms a part.
-- If the Interactive Object returns Standard_True
-- when detected by the Local Context selector through
-- the mouse, the object is kept; if not, it is rejected.
fields
myCol : NameOfColor from Quantity;
myWid : Real from Standard;
hasC,hasW : Boolean from Standard;
end AttributeFilter;

View File

@ -14,10 +14,11 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_AttributeFilter.ixx>
#include <AIS_AttributeFilter.hxx>
#include <AIS_InteractiveObject.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Standard_Type.hxx>
AIS_AttributeFilter::AIS_AttributeFilter():
hasC(Standard_False),

View File

@ -0,0 +1,129 @@
// Created on: 1997-03-04
// Created by: Robert COUBLANC
// 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 _AIS_AttributeFilter_HeaderFile
#define _AIS_AttributeFilter_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <SelectMgr_Filter.hxx>
class SelectMgr_EntityOwner;
class AIS_AttributeFilter;
DEFINE_STANDARD_HANDLE(AIS_AttributeFilter, SelectMgr_Filter)
//! Selects Interactive Objects, which have the desired width or color.
//! The filter questions each Interactive Object in local
//! context to determine whether it has an non-null
//! owner, and if so, whether it has the required color
//! and width attributes. If the object returns true in each
//! case, it is kept. If not, it is rejected.
//! This filter is used only in an open local context.
//! In the Collector viewer, you can only locate
//! Interactive Objects, which answer positively to the
//! filters, which are in position when a local context is open.
class AIS_AttributeFilter : public SelectMgr_Filter
{
public:
//! Constructs an empty attribute filter object.
//! This filter object determines whether selectable
//! interactive objects have a non-null owner.
Standard_EXPORT AIS_AttributeFilter();
//! Constructs an attribute filter object defined by the
//! color attribute aCol.
Standard_EXPORT AIS_AttributeFilter(const Quantity_NameOfColor aCol);
//! Constructs an attribute filter object defined by the line
//! width attribute aWidth.
Standard_EXPORT AIS_AttributeFilter(const Standard_Real aWidth);
//! Indicates that the Interactive Object has the color
//! setting specified by the argument aCol at construction time.
Standard_Boolean HasColor() const;
//! Indicates that the Interactive Object has the width
//! setting specified by the argument aWidth at
//! construction time.
Standard_Boolean HasWidth() const;
//! Sets the color aCol.
//! This must be chosen from the list of colors in Quantity_NameOfColor.
void SetColor (const Quantity_NameOfColor aCol);
//! Sets the line width aWidth.
void SetWidth (const Standard_Real aWidth);
//! Removes the setting for color from the filter.
void UnsetColor();
//! Removes the setting for width from the filter.
void UnsetWidth();
//! Indicates that the selected Interactive Object passes
//! the filter. The owner, anObj, can be either direct or
//! user. A direct owner is the corresponding
//! construction element, whereas a user is the
//! compound shape of which the entity forms a part.
//! If the Interactive Object returns Standard_True
//! when detected by the Local Context selector through
//! the mouse, the object is kept; if not, it is rejected.
Standard_EXPORT virtual Standard_Boolean IsOk (const Handle(SelectMgr_EntityOwner)& anObj) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_AttributeFilter,SelectMgr_Filter)
protected:
private:
Quantity_NameOfColor myCol;
Standard_Real myWid;
Standard_Boolean hasC;
Standard_Boolean hasW;
};
#include <AIS_AttributeFilter.lxx>
#endif // _AIS_AttributeFilter_HeaderFile

View File

@ -1,187 +0,0 @@
-- Created on: 1995-08-09
-- Created by: Arnaud BOUZY/Odile Olivier
-- Copyright (c) 1995-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 Axis from AIS inherits InteractiveObject from AIS
---Purpose: Locates the x, y and z axes in an Interactive Object.
-- These are used to orient it correctly in presentations
-- from different viewpoints, or to construct a revolved
-- shape, for example, from one of the axes. Conversely,
-- an axis can be created to build a revolved shape and
-- then situated relative to one of the axes of the view.
uses
Line from Geom,
Presentation from Prs3d,
PresentationManager3d from PrsMgr,
NameOfColor from Quantity,
Color from Quantity,
Selection from SelectMgr,
Projector from Prs3d,
Transformation from Geom,
Pnt from gp,
Dir from gp,
LineAspect from Prs3d,
TypeOfAxis from AIS,
Axis2Placement from Geom,
Axis1Placement from Geom,
KindOfInteractive from AIS
is
Create(aComponent : Line from Geom)
returns Axis from AIS;
--- Purpose: Initializes the line aComponent
Create( aComponent : Axis2Placement from Geom;
anAxisType: TypeOfAxis from AIS)
---Purpose: initializes the axis2 position
-- aComponent. The coordinate system used is right-handed.
returns Axis from AIS;
Create(anAxis : Axis1Placement from Geom)
returns Axis from AIS;
---Purpose: Initializes the axis1 position anAxis.
Component(me)
---Purpose:
-- Returns the axis entity aComponent and identifies it
-- as a component of a shape.
---C++: inline
---C++: return const &
returns any Line from Geom
is static;
SetComponent(me: mutable;aComponent : Line from Geom)
is static;
---Purpose: Sets the coordinates of the lin aComponent.
Axis2Placement(me)
---C++: inline
---C++: return const &
---Purpose:
-- Returns the position of axis2 and positions it by
-- identifying it as the x, y, or z axis and giving its
-- direction in 3D space. The coordinate system used is right-handed.
returns any Axis2Placement from Geom
is static;
SetAxis2Placement(me: mutable;
aComponent : Axis2Placement from Geom;
anAxisType : TypeOfAxis from AIS)
is static;
---Purpose:
-- Allows you to provide settings for aComponent:the
-- position and direction of an axis in 3D space. The
-- coordinate system used is right-handed.
SetAxis1Placement(me: mutable; anAxis : Axis1Placement from Geom)
is static;
---Purpose: Constructs a new line to serve as the axis anAxis in 3D space.
TypeOfAxis (me)
---C++: inline
---Purpose: Returns the type of axis.
returns TypeOfAxis from AIS;
SetTypeOfAxis (me : mutable;aTypeAxis: TypeOfAxis from AIS)
---C++: inline
---Purpose:
-- Constructs the entity aTypeAxis to stock information
-- concerning type of axis.
is static;
IsXYZAxis (me)
---C++: inline
---Purpose:
-- Returns a signature of 2 for axis datums. When you
-- activate mode 2 by a signature, you pick AIS objects
-- of type AIS_Axis.
returns Boolean from Standard;
AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard is redefined static;
---Purpose: Returns true if the interactive object accepts the display mode aMode.
-- -- Methods from PresentableObject
Compute(me : mutable;
aPresentationManager: PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard = 0)
is redefined static private;
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: Presentation from Prs3d)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined;
---Purpose: computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
-- Methods from SelectableObject
ComputeSelection(me : mutable;
aSelection : Selection from SelectMgr;
aMode : Integer from Standard)is private;
-- -- Methods from InteractiveObject
Signature(me) returns Integer from Standard is redefined;
---C++: inline
Type(me) returns KindOfInteractive from AIS is redefined;
---C++: inline
SetColor(me :mutable; aColor : NameOfColor from Quantity)
is redefined static;
SetColor(me :mutable; aColor : Color from Quantity)
is redefined static;
SetWidth(me:mutable; aValue:Real from Standard) is redefined static;
UnsetColor(me:mutable) is redefined static;
UnsetWidth(me:mutable) is redefined static;
ComputeFields(me: mutable)
is private;
fields
myComponent : Line from Geom;
myAx2 : Axis2Placement from Geom;
myPfirst : Pnt from gp;
myPlast : Pnt from gp;
myTypeOfAxis : TypeOfAxis from AIS;
myIsXYZAxis : Boolean from Standard;
myDir : Dir from gp;
myVal : Real from Standard;
myText : CString from Standard;
myLineAspect : LineAspect from Prs3d;
end Axis;

View File

@ -14,26 +14,33 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_Axis.ixx>
#include <AIS_Axis.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_DatumAspect.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_Structure.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <SelectBasics_EntityOwner.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <StdPrs_Curve.hxx>
#include <TopoDS.hxx>
#include <DsgPrs_XYZAxisPresentation.hxx>
#include <Geom_Axis1Placement.hxx>
#include <Geom_Axis2Placement.hxx>
#include <Geom_Line.hxx>
#include <Geom_Transformation.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <gp_Ax1.hxx>
#include <gp_Ax2.hxx>
#include <Geom_Line.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <DsgPrs_XYZAxisPresentation.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_Structure.hxx>
#include <Prs3d_DatumAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <Quantity_Color.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectBasics_EntityOwner.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard_Type.hxx>
#include <StdPrs_Curve.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TopoDS.hxx>
#include <UnitsAPI.hxx>
//=======================================================================

175
src/AIS/AIS_Axis.hxx Normal file
View File

@ -0,0 +1,175 @@
// Created on: 1995-08-09
// Created by: Arnaud BOUZY/Odile Olivier
// Copyright (c) 1995-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 _AIS_Axis_HeaderFile
#define _AIS_Axis_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <gp_Pnt.hxx>
#include <AIS_TypeOfAxis.hxx>
#include <Standard_Boolean.hxx>
#include <gp_Dir.hxx>
#include <Standard_Real.hxx>
#include <Standard_CString.hxx>
#include <AIS_InteractiveObject.hxx>
#include <Standard_Integer.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <SelectMgr_Selection.hxx>
#include <AIS_KindOfInteractive.hxx>
#include <Quantity_NameOfColor.hxx>
class Geom_Line;
class Geom_Axis2Placement;
class Prs3d_LineAspect;
class Geom_Axis1Placement;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class Quantity_Color;
class AIS_Axis;
DEFINE_STANDARD_HANDLE(AIS_Axis, AIS_InteractiveObject)
//! Locates the x, y and z axes in an Interactive Object.
//! These are used to orient it correctly in presentations
//! from different viewpoints, or to construct a revolved
//! shape, for example, from one of the axes. Conversely,
//! an axis can be created to build a revolved shape and
//! then situated relative to one of the axes of the view.
class AIS_Axis : public AIS_InteractiveObject
{
public:
//! Initializes the line aComponent
Standard_EXPORT AIS_Axis(const Handle(Geom_Line)& aComponent);
//! initializes the axis2 position
//! aComponent. The coordinate system used is right-handed.
Standard_EXPORT AIS_Axis(const Handle(Geom_Axis2Placement)& aComponent, const AIS_TypeOfAxis anAxisType);
//! Initializes the axis1 position anAxis.
Standard_EXPORT AIS_Axis(const Handle(Geom_Axis1Placement)& anAxis);
//! Returns the axis entity aComponent and identifies it
//! as a component of a shape.
const Handle(Geom_Line)& Component() const;
//! Sets the coordinates of the lin aComponent.
Standard_EXPORT void SetComponent (const Handle(Geom_Line)& aComponent);
//! Returns the position of axis2 and positions it by
//! identifying it as the x, y, or z axis and giving its
//! direction in 3D space. The coordinate system used is right-handed.
const Handle(Geom_Axis2Placement)& Axis2Placement() const;
//! Allows you to provide settings for aComponent:the
//! position and direction of an axis in 3D space. The
//! coordinate system used is right-handed.
Standard_EXPORT void SetAxis2Placement (const Handle(Geom_Axis2Placement)& aComponent, const AIS_TypeOfAxis anAxisType);
//! Constructs a new line to serve as the axis anAxis in 3D space.
Standard_EXPORT void SetAxis1Placement (const Handle(Geom_Axis1Placement)& anAxis);
//! Returns the type of axis.
AIS_TypeOfAxis TypeOfAxis() const;
//! Constructs the entity aTypeAxis to stock information
//! concerning type of axis.
void SetTypeOfAxis (const AIS_TypeOfAxis aTypeAxis);
//! Returns a signature of 2 for axis datums. When you
//! activate mode 2 by a signature, you pick AIS objects
//! of type AIS_Axis.
Standard_Boolean IsXYZAxis() const;
//! Returns true if the interactive object accepts the display mode aMode.
Standard_EXPORT Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE;
//! computes the presentation according to a point of view
//! given by <aProjector>.
//! To be Used when the associated degenerated Presentations
//! have been transformed by <aTrsf> which is not a Pure
//! Translation. The HLR Prs can't be deducted automatically
//! WARNING :<aTrsf> must be applied
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
virtual Standard_Integer Signature() const Standard_OVERRIDE;
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
Standard_EXPORT void SetColor (const Quantity_NameOfColor aColor) Standard_OVERRIDE;
Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
Standard_EXPORT void SetWidth (const Standard_Real aValue) Standard_OVERRIDE;
Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
Standard_EXPORT void UnsetWidth() Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_Axis,AIS_InteractiveObject)
protected:
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode);
Standard_EXPORT void ComputeFields();
Handle(Geom_Line) myComponent;
Handle(Geom_Axis2Placement) myAx2;
gp_Pnt myPfirst;
gp_Pnt myPlast;
AIS_TypeOfAxis myTypeOfAxis;
Standard_Boolean myIsXYZAxis;
gp_Dir myDir;
Standard_Real myVal;
Standard_CString myText;
Handle(Prs3d_LineAspect) myLineAspect;
};
#include <AIS_Axis.lxx>
#endif // _AIS_Axis_HeaderFile

View File

@ -1,57 +0,0 @@
-- Created on: 1998-03-04
-- Created by: Julia Gerasimova
-- Copyright (c) 1998-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 BadEdgeFilter from AIS inherits Filter from SelectMgr
---Purpose: A Class
uses
EntityOwner from SelectMgr,
Edge from TopoDS,
DataMapOfIntegerListOfShape from TopTools,
ShapeEnum from TopAbs
is
Create
returns BadEdgeFilter from AIS;
--- Purpose: Constructs an empty filter object for bad edges.
ActsOn( me; aType : ShapeEnum from TopAbs )
returns Boolean from Standard
is redefined;
IsOk( me; EO : EntityOwner from SelectMgr )
returns Boolean from Standard is redefined virtual;
SetContour( me : mutable ; Index : Integer from Standard );
---Purpose: sets <myContour> with current contour. used by
-- IsOk.
AddEdge( me: mutable ; anEdge : Edge from TopoDS;
Index : Integer from Standard );
---Purpose: Adds an edge to the list of non-selectionnable
-- edges.
RemoveEdges( me: mutable ; Index : Integer from Standard );
---Purpose: removes from the list of non-selectionnable edges
-- all edges in the contour <Index>.
fields
myBadEdges : DataMapOfIntegerListOfShape from TopTools;
myContour : Integer from Standard;
end BadEdgeFilter;

View File

@ -16,21 +16,19 @@
// <g_design>
#include <AIS_BadEdgeFilter.ixx>
#include <AIS_BadEdgeFilter.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Standard_Type.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopoDS_Edge.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfIntegerListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
//=======================================================================
//function : AIS_BadEdgeFilter
//purpose :
//=======================================================================
AIS_BadEdgeFilter::AIS_BadEdgeFilter()
{
myContour=0;

View File

@ -0,0 +1,86 @@
// Created on: 1998-03-04
// Created by: Julia Gerasimova
// Copyright (c) 1998-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 _AIS_BadEdgeFilter_HeaderFile
#define _AIS_BadEdgeFilter_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TopTools_DataMapOfIntegerListOfShape.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Filter.hxx>
#include <Standard_Boolean.hxx>
#include <TopAbs_ShapeEnum.hxx>
class SelectMgr_EntityOwner;
class TopoDS_Edge;
class AIS_BadEdgeFilter;
DEFINE_STANDARD_HANDLE(AIS_BadEdgeFilter, SelectMgr_Filter)
//! A Class
class AIS_BadEdgeFilter : public SelectMgr_Filter
{
public:
//! Constructs an empty filter object for bad edges.
Standard_EXPORT AIS_BadEdgeFilter();
Standard_EXPORT virtual Standard_Boolean ActsOn (const TopAbs_ShapeEnum aType) const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean IsOk (const Handle(SelectMgr_EntityOwner)& EO) const Standard_OVERRIDE;
//! sets <myContour> with current contour. used by
//! IsOk.
Standard_EXPORT void SetContour (const Standard_Integer Index);
//! Adds an edge to the list of non-selectionnable
//! edges.
Standard_EXPORT void AddEdge (const TopoDS_Edge& anEdge, const Standard_Integer Index);
//! removes from the list of non-selectionnable edges
//! all edges in the contour <Index>.
Standard_EXPORT void RemoveEdges (const Standard_Integer Index);
DEFINE_STANDARD_RTTI(AIS_BadEdgeFilter,SelectMgr_Filter)
protected:
private:
TopTools_DataMapOfIntegerListOfShape myBadEdges;
Standard_Integer myContour;
};
#endif // _AIS_BadEdgeFilter_HeaderFile

View File

@ -1,42 +0,0 @@
-- Created on: 1998-02-04
-- Created by: Julia GERASIMOVA
-- Copyright (c) 1998-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 C0RegularityFilter from AIS inherits Filter from SelectMgr
---Purpose:
uses
EntityOwner from SelectMgr,
Shape from TopoDS,
ShapeEnum from TopAbs,
MapOfShape from TopTools
is
Create( aShape : Shape from TopoDS )
returns C0RegularityFilter from AIS;
ActsOn( me; aType : ShapeEnum from TopAbs )
returns Boolean from Standard
is redefined;
IsOk( me; EO : EntityOwner from SelectMgr )
returns Boolean from Standard is redefined virtual;
fields
myMapOfEdges : MapOfShape from TopTools;
end C0RegularityFilter;

View File

@ -14,23 +14,24 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_C0RegularityFilter.ixx>
#include <AIS_C0RegularityFilter.hxx>
#include <BRep_Tool.hxx>
#include <GeomAbs_Shape.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Standard_Type.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <TopExp.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopExp.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS.hxx>
#include <GeomAbs_Shape.hxx>
#include <BRep_Tool.hxx>
#include <StdSelect_BRepOwner.hxx>
//=======================================================================
//function : AIS_C0RegularityFilter
//purpose :
//=======================================================================
AIS_C0RegularityFilter::AIS_C0RegularityFilter(const TopoDS_Shape& aShape)
{
TopTools_IndexedDataMapOfShapeListOfShape SubShapes;

View File

@ -0,0 +1,71 @@
// Created on: 1998-02-04
// Created by: Julia GERASIMOVA
// Copyright (c) 1998-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 _AIS_C0RegularityFilter_HeaderFile
#define _AIS_C0RegularityFilter_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TopTools_MapOfShape.hxx>
#include <SelectMgr_Filter.hxx>
#include <Standard_Boolean.hxx>
#include <TopAbs_ShapeEnum.hxx>
class TopoDS_Shape;
class SelectMgr_EntityOwner;
class AIS_C0RegularityFilter;
DEFINE_STANDARD_HANDLE(AIS_C0RegularityFilter, SelectMgr_Filter)
class AIS_C0RegularityFilter : public SelectMgr_Filter
{
public:
Standard_EXPORT AIS_C0RegularityFilter(const TopoDS_Shape& aShape);
Standard_EXPORT virtual Standard_Boolean ActsOn (const TopAbs_ShapeEnum aType) const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean IsOk (const Handle(SelectMgr_EntityOwner)& EO) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_C0RegularityFilter,SelectMgr_Filter)
protected:
private:
TopTools_MapOfShape myMapOfEdges;
};
#endif // _AIS_C0RegularityFilter_HeaderFile

View File

@ -1,114 +0,0 @@
-- Created on: 1996-12-05
-- Created by: Flore Lantheaume/Odile Olivier
-- 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 Chamf2dDimension from AIS inherits Relation from AIS
---Purpose: A framework to define display of 2D chamfers.
-- A chamfer is displayed with arrows and text. The text
-- gives the length of the chamfer if it is a symmetrical
-- chamfer, or the angle if it is not.
uses
PresentationManager3d from PrsMgr,
Presentation from Prs3d,
Selection from SelectMgr,
Shape from TopoDS,
Pnt from gp,
Plane from Geom,
Dir from gp,
Projector from Prs3d,
Transformation from Geom,
ExtendedString from TCollection,
ArrowSide from DsgPrs,
KindOfDimension from AIS
is
Create (aFShape : Shape from TopoDS;
aPlane : Plane from Geom;
aVal : Real from Standard;
aText : ExtendedString from TCollection)
---Purpose: Constructs the display object for 2D chamfers.
-- This object is defined by the face aFShape, the
-- dimension aVal, the plane aPlane and the text aText.
returns Chamf2dDimension from AIS;
Create (aFShape : Shape from TopoDS;
aPlane : Plane from Geom;
aVal : Real from Standard;
aText : ExtendedString from TCollection;
aPosition : Pnt from gp;
aSymbolPrs : ArrowSide from DsgPrs;
anArrowSize : Real from Standard = 0.0)
---Purpose: Constructs the display object for 2D chamfers.
-- This object is defined by the face aFShape, the plane
-- aPlane, the dimension aVal, the position aPosition,
-- the type of arrow aSymbolPrs with the size
-- anArrowSize, and the text aText.
returns Chamf2dDimension from AIS;
KindOfDimension(me)
---Purpose: Indicates that we are concerned with a 2d length.
---C++: inline
returns KindOfDimension from AIS
is redefined;
IsMovable(me) returns Boolean from Standard
---Purpose: Returns true if the 2d chamfer dimension is movable.
---C++: inline
is redefined;
-- Methods from PresentableObject
Compute(me : mutable;
aPresentationManager: PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard= 0)
is redefined static private;
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: Presentation from Prs3d)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined;
---Purpose: computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
ComputeSelection(me : mutable;
aSelection : Selection from SelectMgr;
aMode : Integer from Standard)
is redefined private;
fields
myPntAttach : Pnt from gp;
myDir : Dir from gp;
end Chamf2dDimension;

View File

@ -14,49 +14,41 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_NotImplemented.hxx>
#include <AIS_Chamf2dDimension.ixx>
#include <AIS.hxx>
#include <AIS_Chamf2dDimension.hxx>
#include <Bnd_Box.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepBndLib.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <DsgPrs_Chamf2dPresentation.hxx>
#include <ElCLib.hxx>
#include <Geom_Line.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <gp_Dir.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <Precision.hxx>
#include <ProjLib.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Edge.hxx>
#include <TopAbs_Orientation.hxx>
#include <Bnd_Box.hxx>
#include <BRepBndLib.hxx>
#include <gp_Dir.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
#include <Geom_Line.hxx>
#include <ElCLib.hxx>
#include <Precision.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <AIS.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <ProjLib.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <TopAbs_Orientation.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : Constructor

View File

@ -0,0 +1,114 @@
// Created on: 1996-12-05
// Created by: Flore Lantheaume/Odile Olivier
// 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 _AIS_Chamf2dDimension_HeaderFile
#define _AIS_Chamf2dDimension_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <gp_Pnt.hxx>
#include <gp_Dir.hxx>
#include <AIS_Relation.hxx>
#include <Standard_Real.hxx>
#include <DsgPrs_ArrowSide.hxx>
#include <AIS_KindOfDimension.hxx>
#include <Standard_Boolean.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
class TopoDS_Shape;
class Geom_Plane;
class TCollection_ExtendedString;
class gp_Pnt;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class AIS_Chamf2dDimension;
DEFINE_STANDARD_HANDLE(AIS_Chamf2dDimension, AIS_Relation)
//! A framework to define display of 2D chamfers.
//! A chamfer is displayed with arrows and text. The text
//! gives the length of the chamfer if it is a symmetrical
//! chamfer, or the angle if it is not.
class AIS_Chamf2dDimension : public AIS_Relation
{
public:
//! Constructs the display object for 2D chamfers.
//! This object is defined by the face aFShape, the
//! dimension aVal, the plane aPlane and the text aText.
Standard_EXPORT AIS_Chamf2dDimension(const TopoDS_Shape& aFShape, const Handle(Geom_Plane)& aPlane, const Standard_Real aVal, const TCollection_ExtendedString& aText);
//! Constructs the display object for 2D chamfers.
//! This object is defined by the face aFShape, the plane
//! aPlane, the dimension aVal, the position aPosition,
//! the type of arrow aSymbolPrs with the size
//! anArrowSize, and the text aText.
Standard_EXPORT AIS_Chamf2dDimension(const TopoDS_Shape& aFShape, const Handle(Geom_Plane)& aPlane, const Standard_Real aVal, const TCollection_ExtendedString& aText, const gp_Pnt& aPosition, const DsgPrs_ArrowSide aSymbolPrs, const Standard_Real anArrowSize = 0.0);
//! Indicates that we are concerned with a 2d length.
virtual AIS_KindOfDimension KindOfDimension() const Standard_OVERRIDE;
//! Returns true if the 2d chamfer dimension is movable.
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE;
//! computes the presentation according to a point of view
//! given by <aProjector>.
//! To be Used when the associated degenerated Presentations
//! have been transformed by <aTrsf> which is not a Pure
//! Translation. The HLR Prs can't be deducted automatically
//! WARNING :<aTrsf> must be applied
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_Chamf2dDimension,AIS_Relation)
protected:
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
gp_Pnt myPntAttach;
gp_Dir myDir;
};
#include <AIS_Chamf2dDimension.lxx>
#endif // _AIS_Chamf2dDimension_HeaderFile

View File

@ -1,110 +0,0 @@
-- Created on: 1996-12-05
-- Created by: Odile Olivier
-- 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 Chamf3dDimension from AIS inherits Relation from AIS
---Purpose: A framework to define display of 3D chamfers.
-- A chamfer is displayed with arrows and text. The text
-- gives the length of the chamfer if it is a symmetrical
-- chamfer, or the angle if it is not.
uses
PresentationManager3d from PrsMgr,
Presentation from Prs3d,
Selection from SelectMgr,
Shape from TopoDS,
Pnt from gp,
Dir from gp,
Projector from Prs3d,
Transformation from Geom,
ExtendedString from TCollection,
ArrowSide from DsgPrs,
KindOfDimension from AIS
is
Create (aFShape : Shape from TopoDS;
aVal : Real from Standard;
aText : ExtendedString from TCollection)
---Purpose: Constructs a display object for 3D chamfers.
-- This object is defined by the shape aFShape, the
-- dimension aVal and the text aText.
returns Chamf3dDimension from AIS;
Create (aFShape : Shape from TopoDS;
aVal : Real from Standard;
aText : ExtendedString from TCollection;
aPosition : Pnt from gp;
aSymbolPrs : ArrowSide from DsgPrs;
anArrowSize : Real from Standard = 0.0)
---Purpose: Constructs a display object for 3D chamfers.
-- This object is defined by the shape aFShape, the
-- dimension aVal, the text aText, the point of origin of
-- the chamfer aPosition, the type of arrow aSymbolPrs
-- with the size anArrowSize.
returns Chamf3dDimension from AIS;
KindOfDimension(me)
---Purpose: Indicates that we are concerned with a 3d length.
---C++: inline
returns KindOfDimension from AIS
is redefined;
IsMovable(me) returns Boolean from Standard
---C++: inline
---Purpose: Returns true if the 3d chamfer dimension is movable.
is redefined;
-- Methods from PresentableObject
Compute(me : mutable;
aPresentationManager: PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard= 0)
is redefined static private;
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: Presentation from Prs3d)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined;
---Purpose: computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
ComputeSelection(me : mutable;
aSelection : Selection from SelectMgr;
aMode : Integer from Standard)
is redefined private;
fields
myPntAttach : Pnt from gp;
myDir : Dir from gp;
end Chamf3dDimension;

View File

@ -14,49 +14,40 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_NotImplemented.hxx>
#include <AIS_Chamf3dDimension.ixx>
#include <AIS.hxx>
#include <AIS_Chamf3dDimension.hxx>
#include <Bnd_Box.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepBndLib.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <DsgPrs_Chamf2dPresentation.hxx>
#include <ElCLib.hxx>
#include <Geom_Line.hxx>
#include <Geom_Transformation.hxx>
#include <gp_Dir.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <Precision.hxx>
#include <ProjLib.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Edge.hxx>
#include <TopAbs_Orientation.hxx>
#include <Bnd_Box.hxx>
#include <BRepBndLib.hxx>
#include <gp_Dir.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
#include <Geom_Line.hxx>
#include <ElCLib.hxx>
#include <Precision.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <AIS.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <ProjLib.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <TopAbs_Orientation.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : Constructor

View File

@ -0,0 +1,113 @@
// Created on: 1996-12-05
// Created by: Odile Olivier
// 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 _AIS_Chamf3dDimension_HeaderFile
#define _AIS_Chamf3dDimension_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <gp_Pnt.hxx>
#include <gp_Dir.hxx>
#include <AIS_Relation.hxx>
#include <Standard_Real.hxx>
#include <DsgPrs_ArrowSide.hxx>
#include <AIS_KindOfDimension.hxx>
#include <Standard_Boolean.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
class TopoDS_Shape;
class TCollection_ExtendedString;
class gp_Pnt;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class AIS_Chamf3dDimension;
DEFINE_STANDARD_HANDLE(AIS_Chamf3dDimension, AIS_Relation)
//! A framework to define display of 3D chamfers.
//! A chamfer is displayed with arrows and text. The text
//! gives the length of the chamfer if it is a symmetrical
//! chamfer, or the angle if it is not.
class AIS_Chamf3dDimension : public AIS_Relation
{
public:
//! Constructs a display object for 3D chamfers.
//! This object is defined by the shape aFShape, the
//! dimension aVal and the text aText.
Standard_EXPORT AIS_Chamf3dDimension(const TopoDS_Shape& aFShape, const Standard_Real aVal, const TCollection_ExtendedString& aText);
//! Constructs a display object for 3D chamfers.
//! This object is defined by the shape aFShape, the
//! dimension aVal, the text aText, the point of origin of
//! the chamfer aPosition, the type of arrow aSymbolPrs
//! with the size anArrowSize.
Standard_EXPORT AIS_Chamf3dDimension(const TopoDS_Shape& aFShape, const Standard_Real aVal, const TCollection_ExtendedString& aText, const gp_Pnt& aPosition, const DsgPrs_ArrowSide aSymbolPrs, const Standard_Real anArrowSize = 0.0);
//! Indicates that we are concerned with a 3d length.
virtual AIS_KindOfDimension KindOfDimension() const Standard_OVERRIDE;
//! Returns true if the 3d chamfer dimension is movable.
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE;
//! computes the presentation according to a point of view
//! given by <aProjector>.
//! To be Used when the associated degenerated Presentations
//! have been transformed by <aTrsf> which is not a Pure
//! Translation. The HLR Prs can't be deducted automatically
//! WARNING :<aTrsf> must be applied
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_Chamf3dDimension,AIS_Relation)
protected:
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
gp_Pnt myPntAttach;
gp_Dir myDir;
};
#include <AIS_Chamf3dDimension.lxx>
#endif // _AIS_Chamf3dDimension_HeaderFile

View File

@ -1,166 +0,0 @@
-- Created on: 1997-01-21
-- Created by: Prestataire Christiane ARMAND
-- 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 Circle from AIS inherits InteractiveObject from AIS
---Purpose: Constructs circle datums to be used in construction of
-- composite shapes.
uses
Circle from Geom,
Point from Geom,
Presentation from Prs3d,
PresentationManager3d from PrsMgr,
NameOfColor from Quantity,
Color from Quantity,
Selection from SelectMgr,
Projector from Prs3d,
Transformation from Geom,
Line from AIS,
KindOfInteractive from AIS
is
Create(aCircle : Circle from Geom)
returns Circle from AIS;
---Purpose: Initializes this algorithm for constructing AIS circle
-- datums initializes the circle aCircle
Create(theCircle : Circle from Geom;
theUStart : Real from Standard;
theUEnd : Real from Standard;
theIsFilledCircleSens : Boolean from Standard = Standard_False)
returns Circle from AIS;
---Purpose: Initializes this algorithm for constructing AIS circle datums.
-- Initializes the circle theCircle, the arc
-- starting point theUStart, the arc ending point theUEnd,
-- and the type of sensitivity theIsFilledCircleSens.
Compute(me : mutable;
aPresentationManager: PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard = 0)
is redefined static private;
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: Presentation from Prs3d)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined;
---Purpose: computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
-- Methods from SelectableObject
ComputeSelection(me : mutable;
aSelection : Selection from SelectMgr;
aMode : Integer from Standard)is private;
-- Methods from InteractiveObject
Signature(me) returns Integer from Standard is redefined;
---C++: inline
---Purpose: Returns index 6 by default.
Type(me) returns KindOfInteractive from AIS is redefined;
---C++: inline
---Purpose: Indicates that the type of Interactive Object is a datum.
Circle(me) returns any Circle from Geom;
---C++: inline
---C++: return const &
---Purpose: Returns the circle component defined in SetCircle.
Parameters(me; u1,u2 : in out Real from Standard);
---C++: inline
---Purpose:
-- Constructs instances of the starting point and the end
-- point parameters, u1 and u2.
SetCircle(me:mutable;aCircle : Circle from Geom);
---C++: inline
---Purpose: Allows you to provide settings for the circle datum aCircle.
SetFirstParam(me:mutable;u:Real);
---C++: inline
---Purpose: Allows you to set the parameter u for the starting point of an arc.
SetLastParam(me:mutable;u:Real);
---C++: inline
---Purpose: Allows you to provide the parameter u for the end point of an arc.
SetColor(me :mutable; aColor : NameOfColor from Quantity)
is redefined static;
--- Purpose: Assigns the color aColor to the solid line boundary of the circle datum.
SetColor(me :mutable; aColor : Color from Quantity)
is redefined static;
SetWidth(me:mutable; aValue:Real from Standard)
is redefined static;
---Purpose: Assigns the width aValue to the solid line boundary of the circle datum.
UnsetColor(me:mutable)
is redefined static;
---Purpose: Removes color from the solid line boundary of the circle datum.
UnsetWidth(me:mutable)
is redefined static;
---Purpose: Removes width settings from the solid line boundary of the circle datum.
IsFilledCircleSens (me) returns Boolean from Standard;
---C++: inline
---Purpose: Returns the type of sensitivity for the circle;
SetFilledCircleSens (me: mutable;
theIsFilledCircleSens : Boolean from Standard);
---C++: inline
---Purpose: Sets the type of sensitivity for the circle. If theIsFilledCircleSens set to Standard_True
-- then the whole circle will be detectable, otherwise only the boundary of the circle.
ComputeCircle(me: mutable;
aPresentation : Presentation from Prs3d)
is private;
ComputeArc(me: mutable;
aPresentation : Presentation from Prs3d)
is private;
ComputeCircleSelection(me: mutable;
aSelection : Selection from SelectMgr)
is private;
ComputeArcSelection(me: mutable;
aSelection : Selection from SelectMgr)
is private;
fields
myComponent : Circle from Geom;
myUStart : Real from Standard;
myUEnd : Real from Standard;
myCircleIsArc : Boolean from Standard;
myIsFilledCircleSens : Boolean from Standard;
end Circle ;

View File

@ -14,23 +14,28 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_Circle.ixx>
#include <AIS_Circle.hxx>
#include <AIS_GraphicTool.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <GC_MakeArcOfCircle.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Transformation.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_Structure.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <Quantity_Color.hxx>
#include <Select3D_SensitiveCircle.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Select3D_SensitiveCircle.hxx>
#include <Standard_Type.hxx>
#include <StdPrs_DeflectionCurve.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TopoDS.hxx>
#include <Geom_Circle.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GC_MakeArcOfCircle.hxx>
#include <Quantity_Color.hxx>
#include <AIS_GraphicTool.hxx>
//=======================================================================
//function : AIS_Circle

155
src/AIS/AIS_Circle.hxx Normal file
View File

@ -0,0 +1,155 @@
// Created on: 1997-01-21
// Created by: Prestataire Christiane ARMAND
// 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 _AIS_Circle_HeaderFile
#define _AIS_Circle_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <AIS_InteractiveObject.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
#include <AIS_KindOfInteractive.hxx>
#include <Quantity_NameOfColor.hxx>
class Geom_Circle;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class Quantity_Color;
class AIS_Circle;
DEFINE_STANDARD_HANDLE(AIS_Circle, AIS_InteractiveObject)
//! Constructs circle datums to be used in construction of
//! composite shapes.
class AIS_Circle : public AIS_InteractiveObject
{
public:
//! Initializes this algorithm for constructing AIS circle
//! datums initializes the circle aCircle
Standard_EXPORT AIS_Circle(const Handle(Geom_Circle)& aCircle);
//! Initializes this algorithm for constructing AIS circle datums.
//! Initializes the circle theCircle, the arc
//! starting point theUStart, the arc ending point theUEnd,
//! and the type of sensitivity theIsFilledCircleSens.
Standard_EXPORT AIS_Circle(const Handle(Geom_Circle)& theCircle, const Standard_Real theUStart, const Standard_Real theUEnd, const Standard_Boolean theIsFilledCircleSens = Standard_False);
//! computes the presentation according to a point of view
//! given by <aProjector>.
//! To be Used when the associated degenerated Presentations
//! have been transformed by <aTrsf> which is not a Pure
//! Translation. The HLR Prs can't be deducted automatically
//! WARNING :<aTrsf> must be applied
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
//! Returns index 6 by default.
virtual Standard_Integer Signature() const Standard_OVERRIDE;
//! Indicates that the type of Interactive Object is a datum.
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
//! Returns the circle component defined in SetCircle.
const Handle(Geom_Circle)& Circle() const;
//! Constructs instances of the starting point and the end
//! point parameters, u1 and u2.
void Parameters (Standard_Real& u1, Standard_Real& u2) const;
//! Allows you to provide settings for the circle datum aCircle.
void SetCircle (const Handle(Geom_Circle)& aCircle);
//! Allows you to set the parameter u for the starting point of an arc.
void SetFirstParam (const Standard_Real u);
//! Allows you to provide the parameter u for the end point of an arc.
void SetLastParam (const Standard_Real u);
//! Assigns the color aColor to the solid line boundary of the circle datum.
Standard_EXPORT void SetColor (const Quantity_NameOfColor aColor) Standard_OVERRIDE;
Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
//! Assigns the width aValue to the solid line boundary of the circle datum.
Standard_EXPORT void SetWidth (const Standard_Real aValue) Standard_OVERRIDE;
//! Removes color from the solid line boundary of the circle datum.
Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
//! Removes width settings from the solid line boundary of the circle datum.
Standard_EXPORT void UnsetWidth() Standard_OVERRIDE;
//! Returns the type of sensitivity for the circle;
Standard_Boolean IsFilledCircleSens() const;
//! Sets the type of sensitivity for the circle. If theIsFilledCircleSens set to Standard_True
//! then the whole circle will be detectable, otherwise only the boundary of the circle.
void SetFilledCircleSens (const Standard_Boolean theIsFilledCircleSens);
DEFINE_STANDARD_RTTI(AIS_Circle,AIS_InteractiveObject)
protected:
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode);
Standard_EXPORT void ComputeCircle (const Handle(Prs3d_Presentation)& aPresentation);
Standard_EXPORT void ComputeArc (const Handle(Prs3d_Presentation)& aPresentation);
Standard_EXPORT void ComputeCircleSelection (const Handle(SelectMgr_Selection)& aSelection);
Standard_EXPORT void ComputeArcSelection (const Handle(SelectMgr_Selection)& aSelection);
Handle(Geom_Circle) myComponent;
Standard_Real myUStart;
Standard_Real myUEnd;
Standard_Boolean myCircleIsArc;
Standard_Boolean myIsFilledCircleSens;
};
#include <AIS_Circle.lxx>
#endif // _AIS_Circle_HeaderFile

35
src/AIS/AIS_ClearMode.hxx Normal file
View File

@ -0,0 +1,35 @@
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// 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 _AIS_ClearMode_HeaderFile
#define _AIS_ClearMode_HeaderFile
//! Declares which entities in an opened local context
//! are to be cleared of mode settings. Temporary
//! graphic presentations such as those for sub-shapes,
//! for example, are only created for the selection
//! process. By means of these enumerations, they can
//! be cleared from local context.
enum AIS_ClearMode
{
AIS_CM_All,
AIS_CM_Interactive,
AIS_CM_Filters,
AIS_CM_StandardModes,
AIS_CM_TemporaryShapePrs
};
#endif // _AIS_ClearMode_HeaderFile

View File

@ -1,101 +0,0 @@
-- Created on: 1996-12-05
-- Created by: Flore Lantheaume/Odile Olivier
-- 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 ConcentricRelation from AIS inherits Relation from AIS
---Purpose: A framework to define a constraint by a relation of
-- concentricity between two or more interactive datums.
-- The display of this constraint is also defined.
-- A plane is used to create an axis along which the
-- relation of concentricity can be extended.
uses
PresentationManager3d from PrsMgr,
Presentation from Prs3d,
Selection from SelectMgr,
Shape from TopoDS,
Pnt from gp,
Dir from gp,
Projector from Prs3d,
Transformation from Geom,
Plane from Geom
is
Create (aFShape : Shape from TopoDS;
aSShape : Shape from TopoDS;
aPlane : Plane from Geom)
---Purpose: Constructs the display object for concentric relations
-- between shapes.
-- This object is defined by the two shapes, aFShape
-- and aSShape and the plane aPlane.
-- aPlane is provided to create an axis along which the
-- relation of concentricity can be extended.
returns ConcentricRelation from AIS;
-- Methods from PresentableObject
Compute(me : mutable;
aPresentationManager: PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard= 0)
is redefined static private;
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: Presentation from Prs3d)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined;
---Purpose: computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
ComputeTwoEdgesConcentric(me:mutable;
aPresentationManager: Presentation from Prs3d)
is private;
ComputeEdgeVertexConcentric(me:mutable;
aPresentationManager: Presentation from Prs3d)
is private;
ComputeTwoVerticesConcentric(me:mutable;
aPresentationManager: Presentation from Prs3d)
is private;
-- Methods from SelectableObject
ComputeSelection(me : mutable;
aSelection : Selection from SelectMgr;
aMode : Integer from Standard)
is redefined private;
fields
myCenter : Pnt from gp;
myRad : Real from Standard;
myDir : Dir from gp;
myPnt : Pnt from gp;
end ConcentricRelation;

View File

@ -14,38 +14,37 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_NotImplemented.hxx>
#include <AIS_ConcentricRelation.ixx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <AIS.hxx>
#include <AIS_ConcentricRelation.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <DsgPrs_ConcentricPresentation.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <GeomAbs_CurveType.hxx>
#include <gp_Ax1.hxx>
#include <gp_Ax2.hxx>
#include <gp_Dir.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveCircle.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <DsgPrs_ConcentricPresentation.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TopoDS.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <GeomAbs_CurveType.hxx>
#include <Geom_Circle.hxx>
#include <gp_Dir.hxx>
#include <gp_Vec.hxx>
#include <gp_Ax2.hxx>
#include <gp_Ax1.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pln.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <AIS.hxx>
//=======================================================================
//function : Constructor
//purpose :
//=======================================================================
AIS_ConcentricRelation::AIS_ConcentricRelation(
const TopoDS_Shape& aFShape,
const TopoDS_Shape& aSShape,

View File

@ -0,0 +1,107 @@
// Created on: 1996-12-05
// Created by: Flore Lantheaume/Odile Olivier
// 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 _AIS_ConcentricRelation_HeaderFile
#define _AIS_ConcentricRelation_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <gp_Pnt.hxx>
#include <Standard_Real.hxx>
#include <gp_Dir.hxx>
#include <AIS_Relation.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
class TopoDS_Shape;
class Geom_Plane;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class AIS_ConcentricRelation;
DEFINE_STANDARD_HANDLE(AIS_ConcentricRelation, AIS_Relation)
//! A framework to define a constraint by a relation of
//! concentricity between two or more interactive datums.
//! The display of this constraint is also defined.
//! A plane is used to create an axis along which the
//! relation of concentricity can be extended.
class AIS_ConcentricRelation : public AIS_Relation
{
public:
//! Constructs the display object for concentric relations
//! between shapes.
//! This object is defined by the two shapes, aFShape
//! and aSShape and the plane aPlane.
//! aPlane is provided to create an axis along which the
//! relation of concentricity can be extended.
Standard_EXPORT AIS_ConcentricRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane);
//! computes the presentation according to a point of view
//! given by <aProjector>.
//! To be Used when the associated degenerated Presentations
//! have been transformed by <aTrsf> which is not a Pure
//! Translation. The HLR Prs can't be deducted automatically
//! WARNING :<aTrsf> must be applied
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_ConcentricRelation,AIS_Relation)
protected:
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
Standard_EXPORT void ComputeTwoEdgesConcentric (const Handle(Prs3d_Presentation)& aPresentationManager);
Standard_EXPORT void ComputeEdgeVertexConcentric (const Handle(Prs3d_Presentation)& aPresentationManager);
Standard_EXPORT void ComputeTwoVerticesConcentric (const Handle(Prs3d_Presentation)& aPresentationManager);
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
gp_Pnt myCenter;
Standard_Real myRad;
gp_Dir myDir;
gp_Pnt myPnt;
};
#endif // _AIS_ConcentricRelation_HeaderFile

View File

@ -0,0 +1,38 @@
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// 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 _AIS_ConnectStatus_HeaderFile
#define _AIS_ConnectStatus_HeaderFile
//! Gives the status of connection of an Interactive
//! Object. This will be one of the following:
//! - No connection
//! - Connection
//! - Transformation
//! - Both connection and transformation
//! This enumeration is used in
//! AIS_ConnectedInteractive. Transform indicates
//! that the Interactive Object reference geometry has
//! changed location relative to the reference geometry.
enum AIS_ConnectStatus
{
AIS_CS_None,
AIS_CS_Connection,
AIS_CS_Transform,
AIS_CS_Both
};
#endif // _AIS_ConnectStatus_HeaderFile

View File

@ -1,173 +0,0 @@
-- Created on: 1997-01-08
-- Created by: Robert COUBLANC
-- 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 ConnectedInteractive from AIS inherits InteractiveObject from AIS
---Purpose: Creates an arbitrary located instance of another Interactive Object,
-- which serves as a reference.
-- This allows you to use the Connected Interactive
-- Object without having to recalculate presentation,
-- selection or graphic structure. These are deduced
-- from your reference object.
-- The relation between the connected interactive object
-- and its source is generally one of geometric transformation.
-- AIS_ConnectedInteractive class supports selection mode 0 for any InteractiveObject and
-- all standard modes if its reference based on AIS_Shape.
-- Descendants may redefine ComputeSelection() though.
-- Also ConnectedInteractive will handle HLR if its reference based on AIS_Shape.
uses
Location from TopLoc,
Shape from TopoDS,
Transformation from Geom,
PresentationManager3d from PrsMgr,
Presentation from Prs3d,
TypeOfPresentation3d from PrsMgr,
Selection from SelectMgr,
Projector from Prs3d,
KindOfInteractive from AIS,
Trsf from gp
raises
NotImplemented from Standard
is
Create (aTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr = PrsMgr_TOP_AllView)
returns ConnectedInteractive from AIS;
---Purpose:
-- Disconnects the previous view and sets highlight
-- mode to 0. This highlights the wireframe presentation
-- aTypeOfPresentation3d.
-- Top_AllView deactivates hidden line removal.
Type(me) returns KindOfInteractive from AIS
is redefined virtual;
---Purpose: Returns KOI_Object
Signature(me) returns Integer from Standard
is redefined virtual;
---Purpose: Returns 1
Connect(me : mutable;
anotherIObj : InteractiveObject from AIS) is virtual;
---Purpose: Establishes the connection between the Connected
-- Interactive Object, anotherIobj, and its reference.
Connect(me:mutable;
anotherIobj: InteractiveObject from AIS;
aLocation : Trsf from gp) is virtual;
---Purpose: Establishes the connection between the Connected
-- Interactive Object, anotherIobj, and its reference.
-- Locates instance in aLocation.
HasConnection(me) returns Boolean from Standard;
---C++: inline
---Purpose:
-- Returns true if there is a connection established
-- between the presentation and its source reference.
ConnectedTo(me) returns any InteractiveObject from AIS;
---C++: inline
---C++: return const&
---Purpose:
-- Returns the connection with the reference Interactive Object.
Disconnect(me:mutable);
---Purpose: Clears the connection with a source reference. The
-- presentation will no longer be displayed.
-- Warning Must be done before deleting the presentation.
Compute(me : mutable;
aPresentationManager : PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard = 0)
---Level: Public
---Purpose: Calculates the view aPresentation and its updates.
-- The latter are managed by aPresentationManager.
-- The display mode aMode is 0 by default.
-- this method is redefined virtual;
-- when the instance is connected to another
-- InteractiveObject,this method doesn't
-- compute anything, but just uses the
-- presentation of this last object, with
-- a transformation if there's one stored.
is redefined virtual private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined virtual private;
---Purpose: Computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: Presentation from Prs3d)
is redefined virtual private;
---Purpose: Computes the presentation according to a point of view
-- given by <aProjector>.
ComputeSelection(me:mutable; theSelection : Selection from SelectMgr;
theMode : Integer) is redefined virtual private;
---Level: Public
---Purpose: Generates sensitive entities by copying
-- them from myReference selection, creates and sets an entity
-- owner for this entities and adds them to theSelection
computeSubShapeSelection (me:mutable; theSelection : Selection from SelectMgr;
theMode : Integer) is private;
---Level: Public
---Purpose: Generates sensitive entities by copying
-- them from myReference sub shapes selection, creates and sets an entity
-- owner for this entities and adds them to theSelection
AcceptShapeDecomposition(me) returns Boolean from Standard is
redefined virtual;
---C++: inline
---Purpose: Informs the graphic context that the interactive Object
-- may be decomposed into sub-shapes for dynamic selection.
updateShape(me:mutable;WithLocation:Boolean from Standard = Standard_True)
is static private;
Compute(me:mutable;
aProjector : Projector from Prs3d;
aPresentation: Presentation from Prs3d;
aShape : Shape from TopoDS)
is private;
---Purpose: Computes the presentation according to a point of view
-- given by <aProjector>.
fields
myReference : InteractiveObject from AIS is protected; -- reference object
myShape : Shape from TopoDS; -- used for HLR
end ConnectedInteractive;

View File

@ -14,37 +14,36 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_NotImplemented.hxx>
#include <AIS_ConnectedInteractive.ixx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Select3D_SensitiveEntity.hxx>
#include <AIS_ConnectedInteractive.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_Shape.hxx>
#include <BRepTools.hxx>
#include <Geom_Transformation.hxx>
#include <gp_Trsf.hxx>
#include <NCollection_DataMap.hxx>
#include <Precision.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <PrsMgr_ModedPresentation.hxx>
#include <PrsMgr_Presentation.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <Select3D_SensitiveEntity.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_ProgramError.hxx>
#include <Standard_Type.hxx>
#include <StdPrs_HLRPolyShape.hxx>
#include <StdPrs_WFDeflectionShape.hxx>
#include <StdSelect.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_OrientedShapeMapHasher.hxx>
#include <AIS_InteractiveContext.hxx>
#include <BRepTools.hxx>
#include <Precision.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <Standard_ProgramError.hxx>
#include <StdPrs_WFDeflectionShape.hxx>
#include <StdPrs_HLRPolyShape.hxx>
#include <Prs3d_Drawer.hxx>
#include <AIS_Shape.hxx>
#include <NCollection_DataMap.hxx>
//=======================================================================
//function : AIS_ConnectedInteractive
//purpose :

View File

@ -0,0 +1,167 @@
// Created on: 1997-01-08
// Created by: Robert COUBLANC
// 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 _AIS_ConnectedInteractive_HeaderFile
#define _AIS_ConnectedInteractive_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TopoDS_Shape.hxx>
#include <AIS_InteractiveObject.hxx>
#include <PrsMgr_TypeOfPresentation3d.hxx>
#include <AIS_KindOfInteractive.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <SelectMgr_Selection.hxx>
class AIS_InteractiveObject;
class Standard_NotImplemented;
class gp_Trsf;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class TopoDS_Shape;
class AIS_ConnectedInteractive;
DEFINE_STANDARD_HANDLE(AIS_ConnectedInteractive, AIS_InteractiveObject)
//! Creates an arbitrary located instance of another Interactive Object,
//! which serves as a reference.
//! This allows you to use the Connected Interactive
//! Object without having to recalculate presentation,
//! selection or graphic structure. These are deduced
//! from your reference object.
//! The relation between the connected interactive object
//! and its source is generally one of geometric transformation.
//! AIS_ConnectedInteractive class supports selection mode 0 for any InteractiveObject and
//! all standard modes if its reference based on AIS_Shape.
//! Descendants may redefine ComputeSelection() though.
//! Also ConnectedInteractive will handle HLR if its reference based on AIS_Shape.
class AIS_ConnectedInteractive : public AIS_InteractiveObject
{
public:
//! Disconnects the previous view and sets highlight
//! mode to 0. This highlights the wireframe presentation
//! aTypeOfPresentation3d.
//! Top_AllView deactivates hidden line removal.
Standard_EXPORT AIS_ConnectedInteractive(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
//! Returns KOI_Object
Standard_EXPORT virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
//! Returns 1
Standard_EXPORT virtual Standard_Integer Signature() const Standard_OVERRIDE;
//! Establishes the connection between the Connected
//! Interactive Object, anotherIobj, and its reference.
Standard_EXPORT virtual void Connect (const Handle(AIS_InteractiveObject)& anotherIObj);
//! Establishes the connection between the Connected
//! Interactive Object, anotherIobj, and its reference.
//! Locates instance in aLocation.
Standard_EXPORT virtual void Connect (const Handle(AIS_InteractiveObject)& anotherIobj, const gp_Trsf& aLocation);
//! Returns true if there is a connection established
//! between the presentation and its source reference.
Standard_Boolean HasConnection() const;
//! Returns the connection with the reference Interactive Object.
const Handle(AIS_InteractiveObject)& ConnectedTo() const;
//! Clears the connection with a source reference. The
//! presentation will no longer be displayed.
//! Warning Must be done before deleting the presentation.
Standard_EXPORT void Disconnect();
//! Informs the graphic context that the interactive Object
//! may be decomposed into sub-shapes for dynamic selection.
virtual Standard_Boolean AcceptShapeDecomposition() const Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_ConnectedInteractive,AIS_InteractiveObject)
protected:
Handle(AIS_InteractiveObject) myReference;
private:
//! Calculates the view aPresentation and its updates.
//! The latter are managed by aPresentationManager.
//! The display mode aMode is 0 by default.
//! this method is redefined virtual;
//! when the instance is connected to another
//! InteractiveObject,this method doesn't
//! compute anything, but just uses the
//! presentation of this last object, with
//! a transformation if there's one stored.
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
//! Computes the presentation according to a point of view
//! given by <aProjector>.
//! To be Used when the associated degenerated Presentations
//! have been transformed by <aTrsf> which is not a Pure
//! Translation. The HLR Prs can't be deducted automatically
//! WARNING :<aTrsf> must be applied
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
//! Computes the presentation according to a point of view
//! given by <aProjector>.
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
//! Generates sensitive entities by copying
//! them from myReference selection, creates and sets an entity
//! owner for this entities and adds them to theSelection
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, const Standard_Integer theMode) Standard_OVERRIDE;
//! Generates sensitive entities by copying
//! them from myReference sub shapes selection, creates and sets an entity
//! owner for this entities and adds them to theSelection
Standard_EXPORT void computeSubShapeSelection (const Handle(SelectMgr_Selection)& theSelection, const Standard_Integer theMode);
Standard_EXPORT void updateShape (const Standard_Boolean WithLocation = Standard_True);
//! Computes the presentation according to a point of view
//! given by <aProjector>.
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation, const TopoDS_Shape& aShape);
TopoDS_Shape myShape;
};
#include <AIS_ConnectedInteractive.lxx>
#endif // _AIS_ConnectedInteractive_HeaderFile

View File

@ -1,78 +0,0 @@
-- Created on: 1996-12-05
-- Created by: Odile Olivier
-- 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 DimensionOwner from AIS inherits EntityOwner from SelectMgr
---Purpose: The owner is the entity which makes it possible to link
-- the sensitive primitives and the reference shapes that
-- you want to detect. It stocks the various pieces of
-- information which make it possible to find objects. An
-- owner has a priority which you can modulate, so as to
-- make one entity more selectable than another. You
-- might want to make edges more selectable than
-- faces, for example. In that case, you could attribute sa
-- higher priority to the one compared to the other. An
-- edge, could have priority 5, for example, and a face,
-- priority 4. The default priority is 5.
uses
SelectableObject from SelectMgr,
PresentationManager from PrsMgr,
PresentationManager3d from PrsMgr,
NameOfColor from Quantity,
DimensionSelectionMode from AIS
is
Create (theSelObject : SelectableObject;
theSelMode : DimensionSelectionMode from AIS;
thePriority : Integer from Standard = 0)
returns DimensionOwner from AIS;
---Purpose:
-- Initializes the dimension owner, theSO, and attributes it
-- the priority, thePriority.
SelectionMode (me)
returns DimensionSelectionMode from AIS;
HilightWithColor (me : mutable;
thePM : PresentationManager3d from PrsMgr;
theColor : NameOfColor from Quantity;
theMode : Integer from Standard = 0)
is redefined virtual;
IsHilighted (me;
thePM : PresentationManager from PrsMgr;
theMode : Integer from Standard =0)
returns Boolean from Standard is redefined virtual;
---Purpose: Returns true if an object with the selection mode
-- aMode is highlighted in the presentation manager aPM.
Hilight(me : mutable;
thePM : PresentationManager from PrsMgr;
theMode : Integer from Standard =0) is redefined virtual;
Unhilight(me : mutable;
thePM : PresentationManager from PrsMgr;
theMode : Integer from Standard =0) is redefined virtual;
---Purpose: Removes highlighting from the selected part of dimension.
fields
mySelectionMode : DimensionSelectionMode from AIS;
end DimensionOwner;

View File

@ -14,11 +14,13 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_DimensionOwner.ixx>
#include <AIS_Dimension.hxx>
#include <AIS_DimensionOwner.hxx>
#include <PrsMgr_PresentationManager.hxx>
#include <SelectMgr_SelectableObject.hxx>
#include <Standard_Type.hxx>
#include <StdSelect_Shape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>

View File

@ -0,0 +1,95 @@
// Created on: 1996-12-05
// Created by: Odile Olivier
// 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 _AIS_DimensionOwner_HeaderFile
#define _AIS_DimensionOwner_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <AIS_DimensionSelectionMode.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Standard_Integer.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Standard_Boolean.hxx>
class SelectMgr_SelectableObject;
class PrsMgr_PresentationManager;
class AIS_DimensionOwner;
DEFINE_STANDARD_HANDLE(AIS_DimensionOwner, SelectMgr_EntityOwner)
//! The owner is the entity which makes it possible to link
//! the sensitive primitives and the reference shapes that
//! you want to detect. It stocks the various pieces of
//! information which make it possible to find objects. An
//! owner has a priority which you can modulate, so as to
//! make one entity more selectable than another. You
//! might want to make edges more selectable than
//! faces, for example. In that case, you could attribute sa
//! higher priority to the one compared to the other. An
//! edge, could have priority 5, for example, and a face,
//! priority 4. The default priority is 5.
class AIS_DimensionOwner : public SelectMgr_EntityOwner
{
public:
//! Initializes the dimension owner, theSO, and attributes it
//! the priority, thePriority.
Standard_EXPORT AIS_DimensionOwner(const Handle(SelectMgr_SelectableObject)& theSelObject, const AIS_DimensionSelectionMode theSelMode, const Standard_Integer thePriority = 0);
Standard_EXPORT AIS_DimensionSelectionMode SelectionMode() const;
Standard_EXPORT virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& thePM, const Quantity_NameOfColor theColor, const Standard_Integer theMode = 0) Standard_OVERRIDE;
//! Returns true if an object with the selection mode
//! aMode is highlighted in the presentation manager aPM.
Standard_EXPORT virtual Standard_Boolean IsHilighted (const Handle(PrsMgr_PresentationManager)& thePM, const Standard_Integer theMode = 0) const Standard_OVERRIDE;
Standard_EXPORT virtual void Hilight (const Handle(PrsMgr_PresentationManager)& thePM, const Standard_Integer theMode = 0) Standard_OVERRIDE;
//! Removes highlighting from the selected part of dimension.
Standard_EXPORT virtual void Unhilight (const Handle(PrsMgr_PresentationManager)& thePM, const Standard_Integer theMode = 0) Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_DimensionOwner,SelectMgr_EntityOwner)
protected:
private:
AIS_DimensionSelectionMode mySelectionMode;
};
#endif // _AIS_DimensionOwner_HeaderFile

View File

@ -0,0 +1,28 @@
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// 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 _AIS_DimensionSelectionMode_HeaderFile
#define _AIS_DimensionSelectionMode_HeaderFile
//! Specifies dimension selection modes.
enum AIS_DimensionSelectionMode
{
AIS_DSM_All,
AIS_DSM_Line,
AIS_DSM_Text
};
#endif // _AIS_DimensionSelectionMode_HeaderFile

View File

@ -0,0 +1,31 @@
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// 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 _AIS_DisplayMode_HeaderFile
#define _AIS_DisplayMode_HeaderFile
//! Sets display modes other than neutral point ones,
//! for interactive objects. The possibilities include:
//! - wireframe,
//! - shaded,
enum AIS_DisplayMode
{
AIS_WireFrame,
AIS_Shaded
};
#endif // _AIS_DisplayMode_HeaderFile

View File

@ -0,0 +1,28 @@
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// 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 _AIS_DisplaySpecialSymbol_HeaderFile
#define _AIS_DisplaySpecialSymbol_HeaderFile
//! Specifies dimension special symbol display options
enum AIS_DisplaySpecialSymbol
{
AIS_DSS_No,
AIS_DSS_Before,
AIS_DSS_After
};
#endif // _AIS_DisplaySpecialSymbol_HeaderFile

View File

@ -0,0 +1,36 @@
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// 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 _AIS_DisplayStatus_HeaderFile
#define _AIS_DisplayStatus_HeaderFile
//! To give the display status of an Interactive Object.
//! This will be one of the following:
//! - DS_Displayed: the Interactive Object is
//! displayed in the main viewer;
//! - DS_Erased: the Interactive Object is hidden in main viewer;
//! - DS_Temporary: the Interactive Object is temporarily displayed;
//! - DS_None: the Interactive Object is nowhere displayed.
enum AIS_DisplayStatus
{
AIS_DS_Displayed,
AIS_DS_Erased,
AIS_DS_Temporary,
AIS_DS_None
};
#endif // _AIS_DisplayStatus_HeaderFile

View File

@ -1,86 +0,0 @@
-- Created on: 1998-01-22
-- Created by: Sergey ZARITCHNY
-- Copyright (c) 1998-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.
deferred class EllipseRadiusDimension from AIS inherits Relation from AIS
---Purpose:
-- Computes geometry ( basis curve and plane of dimension)
-- for input shape aShape from TopoDS
-- Root class for MinRadiusDimension and MaxRadiusDimension
uses
Shape from TopoDS,
Elips from gp,
Pnt from gp,
Pln from gp,
Curve from Geom,
OffsetCurve from Geom,
Ellipse from Geom,
Plane from Geom,
Surface from Geom,
ExtendedString from TCollection,
KindOfSurface from AIS,
KindOfDimension from AIS
is
Initialize(aShape : Shape from TopoDS;
aText : ExtendedString from TCollection);
-- Ellipse radius dimension of a Shape which can be Edge
-- or Face (planar or cylindrical(surface of extrusion or
-- surface of offset))
KindOfDimension(me) returns KindOfDimension from AIS
is redefined;
IsMovable(me) returns Boolean from Standard
is redefined;
--
-- Computation private methods
--
ComputeGeometry( me: mutable ) ;
-- is private;
ComputeFaceGeometry(me: mutable)
is private;
ComputeCylFaceGeometry(me: mutable;
aSurfType : KindOfSurface from AIS;
aSurf : Surface from Geom;
Offset : Real from Standard )
is private;
ComputePlanarFaceGeometry(me: mutable)
is private;
ComputeEdgeGeometry(me: mutable)
is private;
fields
myEllipse : Elips from gp is protected;
myFirstPar : Real from Standard is protected;
myLastPar : Real from Standard is protected;
myIsAnArc : Boolean from Standard is protected;
myOffsetCurve : OffsetCurve from Geom is protected;
myOffset : Real from Standard is protected;
myIsOffset : Boolean from Standard is protected;
end EllipseRadiusDimension;

View File

@ -14,49 +14,42 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_EllipseRadiusDimension.ixx>
#include <TCollection_ExtendedString.hxx>
#include <ElCLib.hxx>
#include <ElSLib.hxx>
#include <TopoDS.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <GeomAPI_ExtremaCurveCurve.hxx>
#include <Geom_Line.hxx>
#include <GeomAPI.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Lin.hxx>
#include <gp_Ax1.hxx>
#include <gp_Dir.hxx>
#include <gp_Vec.hxx>
#include <gp_Elips.hxx>
#include <AIS.hxx>
#include <AIS_EllipseRadiusDimension.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <ElCLib.hxx>
#include <ElSLib.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_Line.hxx>
#include <Geom_OffsetCurve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <GeomAPI.hxx>
#include <GeomAPI_ExtremaCurveCurve.hxx>
#include <gp_Ax1.hxx>
#include <gp_Dir.hxx>
#include <gp_Elips.hxx>
#include <gp_Lin.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <Precision.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : AIS_EllipseRadiusDimension
//purpose :
//=======================================================================
AIS_EllipseRadiusDimension::AIS_EllipseRadiusDimension(const TopoDS_Shape& aShape,
const TCollection_ExtendedString& aText)
:AIS_Relation()

View File

@ -0,0 +1,94 @@
// Created on: 1998-01-22
// Created by: Sergey ZARITCHNY
// Copyright (c) 1998-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 _AIS_EllipseRadiusDimension_HeaderFile
#define _AIS_EllipseRadiusDimension_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <gp_Elips.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <AIS_Relation.hxx>
#include <AIS_KindOfDimension.hxx>
#include <AIS_KindOfSurface.hxx>
class Geom_OffsetCurve;
class TopoDS_Shape;
class TCollection_ExtendedString;
class Geom_Surface;
class AIS_EllipseRadiusDimension;
DEFINE_STANDARD_HANDLE(AIS_EllipseRadiusDimension, AIS_Relation)
//! Computes geometry ( basis curve and plane of dimension)
//! for input shape aShape from TopoDS
//! Root class for MinRadiusDimension and MaxRadiusDimension
class AIS_EllipseRadiusDimension : public AIS_Relation
{
public:
Standard_EXPORT virtual AIS_KindOfDimension KindOfDimension() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean IsMovable() const Standard_OVERRIDE;
Standard_EXPORT void ComputeGeometry();
DEFINE_STANDARD_RTTI(AIS_EllipseRadiusDimension,AIS_Relation)
protected:
Standard_EXPORT AIS_EllipseRadiusDimension(const TopoDS_Shape& aShape, const TCollection_ExtendedString& aText);
gp_Elips myEllipse;
Standard_Real myFirstPar;
Standard_Real myLastPar;
Standard_Boolean myIsAnArc;
Handle(Geom_OffsetCurve) myOffsetCurve;
Standard_Real myOffset;
Standard_Boolean myIsOffset;
private:
Standard_EXPORT void ComputeFaceGeometry();
Standard_EXPORT void ComputeCylFaceGeometry (const AIS_KindOfSurface aSurfType, const Handle(Geom_Surface)& aSurf, const Standard_Real Offset);
Standard_EXPORT void ComputePlanarFaceGeometry();
Standard_EXPORT void ComputeEdgeGeometry();
};
#endif // _AIS_EllipseRadiusDimension_HeaderFile

View File

@ -1,195 +0,0 @@
-- Created on: 1998-01-24
-- Created by: Julia GERASIMOVA
-- Copyright (c) 1998-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 EqualDistanceRelation from AIS inherits Relation from AIS
---Purpose: A framework to display equivalent distances between
-- shapes and a given plane.
-- The distance is the length of a projection from the
-- shape to the plane.
-- These distances are used to compare shapes by this vector alone.
uses
Shape from TopoDS,
Plane from Geom,
PresentationManager3d from PrsMgr,
Drawer from Prs3d,
Presentation from Prs3d,
Projector from Prs3d,
Transformation from Geom,
Selection from SelectMgr,
Pnt from gp,
ExtendedString from TCollection,
Edge from TopoDS,
Vertex from TopoDS,
Box from Bnd,
Dir from gp,
ArrowSide from DsgPrs,
TypeOfDist from AIS
is
Create( aShape1 : Shape from TopoDS;
aShape2 : Shape from TopoDS;
aShape3 : Shape from TopoDS;
aShape4 : Shape from TopoDS;
aPlane : Plane from Geom )
---Purpose: Constructs a framework to display equivalent
-- distances between the shapes aShape1, aShape2,
-- aShape3, aShape4 and the plane aPlane.
-- The distance is the length of a projection from the
-- shape to the plane.
returns EqualDistanceRelation from AIS;
SetShape3( me: mutable; aShape : Shape from TopoDS )
is static;
---Purpose:
-- Sets the shape aShape to be used as the shape
-- aShape3 in the framework created at construction time.
---C++: inline
Shape3(me) returns Shape from TopoDS
is static;
---Purpose:
-- Returns the shape aShape3 from the framework
-- created at construction time.
---C++: return const &
---C++: inline
SetShape4( me: mutable; aShape : Shape from TopoDS )
is static;
---C++: inline
---Purpose:
-- Sets the shape aShape to be used as the shape
-- aShape4 in the framework created at construction time.
Shape4(me) returns Shape from TopoDS
is static;
---C++: return const &
---C++: inline
---Purpose:
-- Returns the shape aShape4 from the framework
-- created at construction time.
-- Methods from PresentableObject
Compute( me : mutable;
aPresentationManager: PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard= 0 )
is redefined static private;
Compute( me : mutable;
aProjector : Projector from Prs3d;
aPresentation : Presentation from Prs3d )
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined;
---Purpose: Computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
-- Methods from SelectableObject
ComputeSelection( me : mutable;
aSelection : Selection from SelectMgr;
aMode : Integer from Standard)
is private;
-- ota -- begin
ComputeTwoEdgesLength (myclass;
aPresentation : Presentation from Prs3d;
aDrawer : Drawer from Prs3d;
ArrowSize : Real from Standard;
FirstEdge : Edge from TopoDS;
SecondEdge : Edge from TopoDS;
Plane : Plane from Geom;
AutomaticPos : Boolean from Standard;
IsSetBndBox : Boolean from Standard;
BndBox : Box from Bnd;
Position : out Pnt from gp;
FirstAttach : out Pnt from gp;
SecondAttach : out Pnt from gp;
FirstExtreme : out Pnt from gp;
SecondExtreme : out Pnt from gp;
SymbolPrs : out ArrowSide from DsgPrs );
---Purpose: Computes the location of an intreval between
-- between two edges. FirstAttach , SecondAttach
-- are the returned extreme points of the interval.
ComputeTwoVerticesLength(myclass;
aPresentation : Presentation from Prs3d;
aDrawer : Drawer from Prs3d;
ArrowSize : Real from Standard;
FirstVertex : Vertex from TopoDS;
SecondVertex : Vertex from TopoDS;
Plane : Plane from Geom;
AutomaticPos : Boolean from Standard;
IsSetBndBox : Boolean from Standard;
BndBox : Box from Bnd;
TypeDist : TypeOfDist from AIS;
Position : out Pnt from gp;
FirstAttach : out Pnt from gp;
SecondAttach : out Pnt from gp;
FirstExtreme : out Pnt from gp;
SecondExtreme : out Pnt from gp;
SymbolPrs : out ArrowSide from DsgPrs );
---Purpose: Computes the interval position between two vertexs. FirstAttach,
-- SecondAttach are the returned extreme points of the interval.
ComputeOneEdgeOneVertexLength(myclass;
aPresentation : Presentation from Prs3d;
aDrawer : Drawer from Prs3d;
ArrowSize : Real from Standard;
FirstShape : Shape from TopoDS;
SecondShape : Shape from TopoDS;
Plane : Plane from Geom;
AutomaticPos : Boolean from Standard;
IsSetBndBox : Boolean from Standard;
BndBox : Box from Bnd;
Position : out Pnt from gp;
FirstAttach : out Pnt from gp;
SecondAttach : out Pnt from gp;
FirstExtreme : out Pnt from gp;
SecondExtreme : out Pnt from gp;
SymbolPrs : out ArrowSide from DsgPrs );
---Purpose: Compute the interval location between a vertex and an edge. Edge may be
-- a line or a circle.
-- ota -- end
fields
myShape3 : Shape from TopoDS;
myShape4 : Shape from TopoDS;
myAttachPoint1 : Pnt from gp; -- the start points of constraint curves
myAttachPoint2 : Pnt from gp;
myAttachPoint3 : Pnt from gp;
myAttachPoint4 : Pnt from gp;
myPoint1 : Pnt from gp; -- the end points constraint curves
myPoint2 : Pnt from gp;
myPoint3 : Pnt from gp;
myPoint4 : Pnt from gp;
end EqualDistanceRelation;

View File

@ -14,38 +14,44 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_NotImplemented.hxx>
#include <AIS_EqualDistanceRelation.ixx>
#include <DsgPrs_EqualDistancePresentation.hxx>
#include <AIS_EqualDistanceRelation.hxx>
#include <AIS_LengthDimension.hxx>
#include <gp_Lin.hxx>
#include <DsgPrs_EqualDistancePresentation.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveCircle.hxx>
#include <Precision.hxx>
#include <Bnd_Box.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <TopoDS_Vertex.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRep_Tool.hxx>
#include <DsgPrs_EqualDistancePresentation.hxx>
#include <ElCLib.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Line.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <gp_Lin.hxx>
#include <gp_Pnt.hxx>
#include <Precision.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Geom_Line.hxx>
#include <Geom_Circle.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <ElCLib.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveCircle.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
//=======================================================================
//function : AIS_EqualDistanceRelation
//purpose :
//=======================================================================
AIS_EqualDistanceRelation::AIS_EqualDistanceRelation( const TopoDS_Shape& aShape1,
const TopoDS_Shape& aShape2,
const TopoDS_Shape& aShape3,

View File

@ -0,0 +1,148 @@
// Created on: 1998-01-24
// Created by: Julia GERASIMOVA
// Copyright (c) 1998-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 _AIS_EqualDistanceRelation_HeaderFile
#define _AIS_EqualDistanceRelation_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TopoDS_Shape.hxx>
#include <gp_Pnt.hxx>
#include <AIS_Relation.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
#include <Prs3d_Drawer.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <DsgPrs_ArrowSide.hxx>
#include <AIS_TypeOfDist.hxx>
class TopoDS_Shape;
class Geom_Plane;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class TopoDS_Edge;
class Bnd_Box;
class gp_Pnt;
class TopoDS_Vertex;
class AIS_EqualDistanceRelation;
DEFINE_STANDARD_HANDLE(AIS_EqualDistanceRelation, AIS_Relation)
//! A framework to display equivalent distances between
//! shapes and a given plane.
//! The distance is the length of a projection from the
//! shape to the plane.
//! These distances are used to compare shapes by this vector alone.
class AIS_EqualDistanceRelation : public AIS_Relation
{
public:
//! Constructs a framework to display equivalent
//! distances between the shapes aShape1, aShape2,
//! aShape3, aShape4 and the plane aPlane.
//! The distance is the length of a projection from the
//! shape to the plane.
Standard_EXPORT AIS_EqualDistanceRelation(const TopoDS_Shape& aShape1, const TopoDS_Shape& aShape2, const TopoDS_Shape& aShape3, const TopoDS_Shape& aShape4, const Handle(Geom_Plane)& aPlane);
//! Sets the shape aShape to be used as the shape
//! aShape3 in the framework created at construction time.
void SetShape3 (const TopoDS_Shape& aShape);
//! Returns the shape aShape3 from the framework
//! created at construction time.
const TopoDS_Shape& Shape3() const;
//! Sets the shape aShape to be used as the shape
//! aShape4 in the framework created at construction time.
void SetShape4 (const TopoDS_Shape& aShape);
//! Returns the shape aShape4 from the framework
//! created at construction time.
const TopoDS_Shape& Shape4() const;
//! Computes the presentation according to a point of view
//! given by <aProjector>.
//! To be Used when the associated degenerated Presentations
//! have been transformed by <aTrsf> which is not a Pure
//! Translation. The HLR Prs can't be deducted automatically
//! WARNING :<aTrsf> must be applied
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
//! Computes the location of an intreval between
//! between two edges. FirstAttach , SecondAttach
//! are the returned extreme points of the interval.
Standard_EXPORT static void ComputeTwoEdgesLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Edge& FirstEdge, const TopoDS_Edge& SecondEdge, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
//! Computes the interval position between two vertexs. FirstAttach,
//! SecondAttach are the returned extreme points of the interval.
Standard_EXPORT static void ComputeTwoVerticesLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Vertex& FirstVertex, const TopoDS_Vertex& SecondVertex, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, const AIS_TypeOfDist TypeDist, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
//! Compute the interval location between a vertex and an edge. Edge may be
//! a line or a circle.
Standard_EXPORT static void ComputeOneEdgeOneVertexLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
DEFINE_STANDARD_RTTI(AIS_EqualDistanceRelation,AIS_Relation)
protected:
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode);
TopoDS_Shape myShape3;
TopoDS_Shape myShape4;
gp_Pnt myAttachPoint1;
gp_Pnt myAttachPoint2;
gp_Pnt myAttachPoint3;
gp_Pnt myAttachPoint4;
gp_Pnt myPoint1;
gp_Pnt myPoint2;
gp_Pnt myPoint3;
gp_Pnt myPoint4;
};
#include <AIS_EqualDistanceRelation.lxx>
#endif // _AIS_EqualDistanceRelation_HeaderFile

View File

@ -1,82 +0,0 @@
-- Created on: 1998-01-17
-- Created by: Julia GERASIMOVA
-- Copyright (c) 1998-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 EqualRadiusRelation from AIS inherits Relation from AIS
---Purpose:
uses
Edge from TopoDS,
Plane from Geom,
PresentationManager3d from PrsMgr,
Presentation from Prs3d,
Projector from Prs3d,
Transformation from Geom,
Selection from SelectMgr,
Pnt from gp
is
Create( aFirstEdge : Edge from TopoDS;
aSecondEdge : Edge from TopoDS;
aPlane : Plane from Geom )
---Purpose: Creates equal relation of two arc's radiuses.
-- If one of edges is not in the given plane,
-- the presentation method projects it onto the plane.
returns EqualRadiusRelation from AIS;
-- Methods from PresentableObject
Compute( me : mutable;
aPresentationManager: PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard= 0 )
is redefined static private;
Compute( me : mutable;
aProjector : Projector from Prs3d;
aPresentation : Presentation from Prs3d )
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined;
---Purpose: computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
-- Methods from SelectableObject
ComputeSelection( me : mutable;
aSelection : Selection from SelectMgr;
aMode : Integer from Standard)
is private;
ComputeRadiusPosition(me: mutable) is private;
fields
myFirstCenter : Pnt from gp;
mySecondCenter : Pnt from gp;
myFirstPoint : Pnt from gp;
mySecondPoint : Pnt from gp;
end EqualRadiusRelation;

View File

@ -14,32 +14,36 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_NotImplemented.hxx>
#include <AIS_EqualRadiusRelation.ixx>
#include <AIS.hxx>
#include <DsgPrs_EqualRadiusPresentation.hxx>
#include <AIS_EqualRadiusRelation.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <TopoDS.hxx>
#include <gp_Circ.hxx>
#include <Geom_Circle.hxx>
#include <DsgPrs_EqualRadiusPresentation.hxx>
#include <ElCLib.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <gp_Circ.hxx>
#include <Precision.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Precision.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
//=======================================================================
//function : AIS_EqualRadiusRelation
//purpose :
//=======================================================================
AIS_EqualRadiusRelation::AIS_EqualRadiusRelation( const TopoDS_Edge& aFirstEdge,
const TopoDS_Edge& aSecondEdge,
const Handle( Geom_Plane )& aPlane )

View File

@ -0,0 +1,94 @@
// Created on: 1998-01-17
// Created by: Julia GERASIMOVA
// Copyright (c) 1998-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 _AIS_EqualRadiusRelation_HeaderFile
#define _AIS_EqualRadiusRelation_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <gp_Pnt.hxx>
#include <AIS_Relation.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
class TopoDS_Edge;
class Geom_Plane;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class AIS_EqualRadiusRelation;
DEFINE_STANDARD_HANDLE(AIS_EqualRadiusRelation, AIS_Relation)
class AIS_EqualRadiusRelation : public AIS_Relation
{
public:
//! Creates equal relation of two arc's radiuses.
//! If one of edges is not in the given plane,
//! the presentation method projects it onto the plane.
Standard_EXPORT AIS_EqualRadiusRelation(const TopoDS_Edge& aFirstEdge, const TopoDS_Edge& aSecondEdge, const Handle(Geom_Plane)& aPlane);
//! computes the presentation according to a point of view
//! given by <aProjector>.
//! To be Used when the associated degenerated Presentations
//! have been transformed by <aTrsf> which is not a Pure
//! Translation. The HLR Prs can't be deducted automatically
//! WARNING :<aTrsf> must be applied
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_EqualRadiusRelation,AIS_Relation)
protected:
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode);
Standard_EXPORT void ComputeRadiusPosition();
gp_Pnt myFirstCenter;
gp_Pnt mySecondCenter;
gp_Pnt myFirstPoint;
gp_Pnt mySecondPoint;
};
#endif // _AIS_EqualRadiusRelation_HeaderFile

View File

@ -1,121 +0,0 @@
-- Created on: 1997-11-28
-- Created by: Robert COUBLANC
-- 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 ExclusionFilter from AIS inherits Filter from SelectMgr
---Purpose: A framework to reject or to accept only objects of
-- given types and/or signatures.
-- Objects are stored, and the stored objects - along
-- with the flag settings - are used to define the filter.
-- Objects to be filtered are compared with the stored
-- objects added to the filter, and are accepted or
-- rejected according to the exclusion flag setting.
-- - Exclusion flag on
-- - the function IsOk answers true for all objects,
-- except those of the types and signatures stored
-- in the filter framework
-- - Exclusion flag off
-- - the funciton IsOk answers true for all objects
-- which have the same type and signature as the stored ones.
uses
EntityOwner from SelectMgr,
KindOfInteractive from AIS,
ListOfInteger from TColStd,
DataMapOfIntegerListOfInteger from TColStd
is
Create(ExclusionFlagOn:Boolean from Standard = Standard_True)
returns ExclusionFilter from AIS;
---Purpose: Constructs an empty exclusion filter object defined by
-- the flag setting ExclusionFlagOn.
-- By default, the flag is set to true.
Create(TypeToExclude : KindOfInteractive from AIS;
ExclusionFlagOn : Boolean from Standard = Standard_True)
returns ExclusionFilter from AIS;
---Purpose: All the AIS objects of <TypeToExclude>
-- Will be rejected by the IsOk Method.
Create(TypeToExclude : KindOfInteractive from AIS;
SignatureInType :Integer from Standard ;
ExclusionFlagOn : Boolean from Standard = Standard_True)
returns ExclusionFilter from AIS;
---Purpose: Constructs an exclusion filter object defined by the
-- enumeration value TypeToExclude, the signature
-- SignatureInType, and the flag setting ExclusionFlagOn.
-- By default, the flag is set to true.
IsOk(me; anObj : EntityOwner from SelectMgr)
returns Boolean from Standard
is redefined virtual;
---Category: Load Filter...
Add(me:mutable;TypeToExclude : KindOfInteractive from AIS)
returns Boolean from Standard;
---Purpose: Adds the type TypeToExclude to the list of types.
Add(me:mutable;
TypeToExclude : KindOfInteractive from AIS;
SignatureInType : Integer from Standard)
returns Boolean from Standard;
Remove(me:mutable;
TypeToExclude:KindOfInteractive from AIS)
returns Boolean from Standard;
Remove(me:mutable;
TypeToExclude:KindOfInteractive from AIS;
SignatureInType : Integer from Standard)
returns Boolean from Standard;
Clear(me:mutable);
---Category: Information about Filter...
IsExclusionFlagOn(me) returns Boolean from Standard;
---C++: inline
SetExclusionFlag(me:mutable; Status : Boolean from Standard);
---C++: inline
IsStored(me;aType:KindOfInteractive from AIS) returns Boolean from Standard;
ListOfStoredTypes( me; TheList: in out ListOfInteger from TColStd);
ListOfSignature(me;
aType : KindOfInteractive from AIS;
TheStoredList : in out ListOfInteger from TColStd);
IsSignatureIn(me;aType:KindOfInteractive from AIS;aSignature:Integer from Standard)
returns Boolean from Standard is static private;
fields
myIsExclusionFlagOn : Boolean from Standard;
myStoredTypes : DataMapOfIntegerListOfInteger from TColStd;
end ExclusionFilter;

View File

@ -14,17 +14,19 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_ExclusionFilter.ixx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
#include <AIS_ExclusionFilter.hxx>
#include <AIS_InteractiveObject.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Standard_Type.hxx>
#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
//=======================================================================
//function : AIS_ExclusionFilter
//purpose : Constructors
//=======================================================================
AIS_ExclusionFilter::AIS_ExclusionFilter(const Standard_Boolean ExclusionFlagOn):
myIsExclusionFlagOn(ExclusionFlagOn)
{

View File

@ -0,0 +1,121 @@
// Created on: 1997-11-28
// Created by: Robert COUBLANC
// 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 _AIS_ExclusionFilter_HeaderFile
#define _AIS_ExclusionFilter_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Boolean.hxx>
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
#include <SelectMgr_Filter.hxx>
#include <AIS_KindOfInteractive.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_ListOfInteger.hxx>
class SelectMgr_EntityOwner;
class AIS_ExclusionFilter;
DEFINE_STANDARD_HANDLE(AIS_ExclusionFilter, SelectMgr_Filter)
//! A framework to reject or to accept only objects of
//! given types and/or signatures.
//! Objects are stored, and the stored objects - along
//! with the flag settings - are used to define the filter.
//! Objects to be filtered are compared with the stored
//! objects added to the filter, and are accepted or
//! rejected according to the exclusion flag setting.
//! - Exclusion flag on
//! - the function IsOk answers true for all objects,
//! except those of the types and signatures stored
//! in the filter framework
//! - Exclusion flag off
//! - the funciton IsOk answers true for all objects
//! which have the same type and signature as the stored ones.
class AIS_ExclusionFilter : public SelectMgr_Filter
{
public:
//! Constructs an empty exclusion filter object defined by
//! the flag setting ExclusionFlagOn.
//! By default, the flag is set to true.
Standard_EXPORT AIS_ExclusionFilter(const Standard_Boolean ExclusionFlagOn = Standard_True);
//! All the AIS objects of <TypeToExclude>
//! Will be rejected by the IsOk Method.
Standard_EXPORT AIS_ExclusionFilter(const AIS_KindOfInteractive TypeToExclude, const Standard_Boolean ExclusionFlagOn = Standard_True);
//! Constructs an exclusion filter object defined by the
//! enumeration value TypeToExclude, the signature
//! SignatureInType, and the flag setting ExclusionFlagOn.
//! By default, the flag is set to true.
Standard_EXPORT AIS_ExclusionFilter(const AIS_KindOfInteractive TypeToExclude, const Standard_Integer SignatureInType, const Standard_Boolean ExclusionFlagOn = Standard_True);
Standard_EXPORT virtual Standard_Boolean IsOk (const Handle(SelectMgr_EntityOwner)& anObj) const Standard_OVERRIDE;
//! Adds the type TypeToExclude to the list of types.
Standard_EXPORT Standard_Boolean Add (const AIS_KindOfInteractive TypeToExclude);
Standard_EXPORT Standard_Boolean Add (const AIS_KindOfInteractive TypeToExclude, const Standard_Integer SignatureInType);
Standard_EXPORT Standard_Boolean Remove (const AIS_KindOfInteractive TypeToExclude);
Standard_EXPORT Standard_Boolean Remove (const AIS_KindOfInteractive TypeToExclude, const Standard_Integer SignatureInType);
Standard_EXPORT void Clear();
Standard_Boolean IsExclusionFlagOn() const;
void SetExclusionFlag (const Standard_Boolean Status);
Standard_EXPORT Standard_Boolean IsStored (const AIS_KindOfInteractive aType) const;
Standard_EXPORT void ListOfStoredTypes (TColStd_ListOfInteger& TheList) const;
Standard_EXPORT void ListOfSignature (const AIS_KindOfInteractive aType, TColStd_ListOfInteger& TheStoredList) const;
DEFINE_STANDARD_RTTI(AIS_ExclusionFilter,SelectMgr_Filter)
protected:
private:
Standard_EXPORT Standard_Boolean IsSignatureIn (const AIS_KindOfInteractive aType, const Standard_Integer aSignature) const;
Standard_Boolean myIsExclusionFlagOn;
TColStd_DataMapOfIntegerListOfInteger myStoredTypes;
};
#include <AIS_ExclusionFilter.lxx>
#endif // _AIS_ExclusionFilter_HeaderFile

View File

@ -1,195 +0,0 @@
-- Created on: 1996-12-05
-- Created by: Flore Lantheaume/Odile Olivier
-- 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 FixRelation from AIS inherits Relation from AIS
---Purpose: Constructs and manages a constraint by a fixed
-- relation between two or more interactive datums. This
-- constraint is represented by a wire from a shape -
-- point, vertex, or edge - in the first datum and a
-- corresponding shape in the second.
-- Warning: This relation is not bound with any kind of parametric
-- constraint : it represents the "status" of an parametric
-- object.
uses
PresentationManager3d from PrsMgr,
Presentation from Prs3d,
Selection from SelectMgr,
Shape from TopoDS,
Vertex from TopoDS,
Edge from TopoDS,
Wire from TopoDS,
Curve from Geom,
Circ from gp,
Lin from gp,
Pnt from gp,
Projector from Prs3d,
Transformation from Geom,
Plane from Geom
is
Create (aShape : Shape from TopoDS;
aPlane : Plane from Geom;
aWire : Wire from TopoDS)
---Purpose: initializes the vertex aShape, the
-- plane aPlane and the wire aWire, which connects
-- the two vertices in a fixed relation.
returns FixRelation from AIS;
Create (aShape : Shape from TopoDS;
aPlane : Plane from Geom;
aWire : Wire from TopoDS;
aPosition : Pnt from gp;
anArrowSize : Real from Standard = 0.01)
---Purpose: initializes the vertex aShape, the
-- plane aPlane and the wire aWire, the position
-- aPosition, the arrow size anArrowSize and the
-- wire aWire, which connects the two vertices in a fixed relation.
returns FixRelation from AIS;
Create (aShape : Shape from TopoDS;
aPlane : Plane from Geom)
---Purpose: initializes the edge aShape and the plane aPlane.
returns FixRelation from AIS;
Create (aShape : Shape from TopoDS;
aPlane : Plane from Geom;
aPosition : Pnt from gp;
anArrowSize : Real from Standard = 0.01)
---Purpose: initializes the edge aShape, the
-- plane aPlane, the position aPosition and the arrow
-- size anArrowSize.
returns FixRelation from AIS;
Wire(me: mutable) returns Wire from TopoDS
is static;
---Purpose: Returns the wire which connects vertices in a fixed relation.
SetWire(me: mutable;aWire : Wire from TopoDS)
is static;
--- Purpose: Constructs the wire aWire. This connects vertices
-- which are in a fixed relation.
IsMovable(me) returns Boolean from Standard
---C++: inline
---Purpose: Returns true if the Interactive Objects in the relation
-- are movable.
is redefined;
-- Methods from PresentableObject
Compute(me : mutable;
aPresentationManager: PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard= 0)
is redefined static private;
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: Presentation from Prs3d)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined;
---Purpose: computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
-- Methods from SelectableObject
ComputeSelection(me : mutable;
aSelection : Selection from SelectMgr;
aMode : Integer from Standard)
is redefined private;
--
-- Computation private methods
--
ComputeVertex(me : mutable;
FixVertex : Vertex from TopoDS;
curpos : out Pnt from gp)
---Purpose: computes the presentation for <myFixShape> if it's a
-- vertex.
is private;
ComputePosition(me;
curv1 : Curve from Geom;
curv2 : Curve from Geom;
firstp1 : Pnt from gp;
lastp1 : Pnt from gp ;
firstp2 : Pnt from gp;
lastp2 : Pnt from gp)
returns Pnt from gp
is private;
ComputePosition(me;
curv : Curve from Geom;
firstp : Pnt from gp;
lastp : Pnt from gp)
returns Pnt from gp
is private;
ComputeEdge(me : mutable;
FixEdge : Edge from TopoDS;
curpos : out Pnt from gp)
---Purpose: computes the presentation for <myFixShape> if it's a
-- edge.
is private;
ComputeLinePosition(me : mutable;
glin : Lin from gp;
pos : out Pnt from gp;
pfirst : out Real from Standard;
plast : out Real from Standard)
is private;
ComputeCirclePosition(me : mutable;
gcirc : Circ from gp;
pos : out Pnt from gp;
pfirst : out Real from Standard;
plast : out Real from Standard)
is private;
ConnectedEdges(myclass; aWire : Wire from TopoDS;
aVertex : Vertex from TopoDS;
Edge1,Edge2 : out Edge from TopoDS)
returns Boolean from Standard
is private;
fields
myWire : Wire from TopoDS;
myPntAttach : Pnt from gp;
end FixRelation;

View File

@ -14,55 +14,49 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_NotImplemented.hxx>
#include <AIS_FixRelation.ixx>
#include <AIS.hxx>
#include <AIS_FixRelation.hxx>
#include <AIS_Shape.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#include <DsgPrs_FixPresentation.hxx>
#include <ElCLib.hxx>
#include <ElSLib.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Line.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <gp_Ax1.hxx>
#include <gp_Circ.hxx>
#include <gp_Dir.hxx>
#include <gp_Lin.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_XYZ.hxx>
#include <Precision.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TColStd_ListIteratorOfListOfTransient.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopExp.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TColStd_ListIteratorOfListOfTransient.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Line.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Plane.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir.hxx>
#include <gp_Ax1.hxx>
#include <gp_XYZ.hxx>
#include <ElCLib.hxx>
#include <ElSLib.hxx>
#include <Precision.hxx>
#include <Standard_DomainError.hxx>
#include <DsgPrs_FixPresentation.hxx>
#include <AIS.hxx>
static Standard_Boolean InDomain(const Standard_Real fpar,
const Standard_Real lpar,
const Standard_Real para)

151
src/AIS/AIS_FixRelation.hxx Normal file
View File

@ -0,0 +1,151 @@
// Created on: 1996-12-05
// Created by: Flore Lantheaume/Odile Olivier
// 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 _AIS_FixRelation_HeaderFile
#define _AIS_FixRelation_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TopoDS_Wire.hxx>
#include <gp_Pnt.hxx>
#include <AIS_Relation.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
class TopoDS_Shape;
class Geom_Plane;
class TopoDS_Wire;
class gp_Pnt;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class TopoDS_Vertex;
class Geom_Curve;
class TopoDS_Edge;
class gp_Lin;
class gp_Circ;
class AIS_FixRelation;
DEFINE_STANDARD_HANDLE(AIS_FixRelation, AIS_Relation)
//! Constructs and manages a constraint by a fixed
//! relation between two or more interactive datums. This
//! constraint is represented by a wire from a shape -
//! point, vertex, or edge - in the first datum and a
//! corresponding shape in the second.
//! Warning: This relation is not bound with any kind of parametric
//! constraint : it represents the "status" of an parametric
//! object.
class AIS_FixRelation : public AIS_Relation
{
public:
//! initializes the vertex aShape, the
//! plane aPlane and the wire aWire, which connects
//! the two vertices in a fixed relation.
Standard_EXPORT AIS_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane, const TopoDS_Wire& aWire);
//! initializes the vertex aShape, the
//! plane aPlane and the wire aWire, the position
//! aPosition, the arrow size anArrowSize and the
//! wire aWire, which connects the two vertices in a fixed relation.
Standard_EXPORT AIS_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane, const TopoDS_Wire& aWire, const gp_Pnt& aPosition, const Standard_Real anArrowSize = 0.01);
//! initializes the edge aShape and the plane aPlane.
Standard_EXPORT AIS_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane);
//! initializes the edge aShape, the
//! plane aPlane, the position aPosition and the arrow
//! size anArrowSize.
Standard_EXPORT AIS_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane, const gp_Pnt& aPosition, const Standard_Real anArrowSize = 0.01);
//! Returns the wire which connects vertices in a fixed relation.
Standard_EXPORT TopoDS_Wire Wire();
//! Constructs the wire aWire. This connects vertices
//! which are in a fixed relation.
Standard_EXPORT void SetWire (const TopoDS_Wire& aWire);
//! Returns true if the Interactive Objects in the relation
//! are movable.
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE;
//! computes the presentation according to a point of view
//! given by <aProjector>.
//! To be Used when the associated degenerated Presentations
//! have been transformed by <aTrsf> which is not a Pure
//! Translation. The HLR Prs can't be deducted automatically
//! WARNING :<aTrsf> must be applied
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_FixRelation,AIS_Relation)
protected:
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
//! computes the presentation for <myFixShape> if it's a
//! vertex.
Standard_EXPORT void ComputeVertex (const TopoDS_Vertex& FixVertex, gp_Pnt& curpos);
Standard_EXPORT gp_Pnt ComputePosition (const Handle(Geom_Curve)& curv1, const Handle(Geom_Curve)& curv2, const gp_Pnt& firstp1, const gp_Pnt& lastp1, const gp_Pnt& firstp2, const gp_Pnt& lastp2) const;
Standard_EXPORT gp_Pnt ComputePosition (const Handle(Geom_Curve)& curv, const gp_Pnt& firstp, const gp_Pnt& lastp) const;
//! computes the presentation for <myFixShape> if it's a
//! edge.
Standard_EXPORT void ComputeEdge (const TopoDS_Edge& FixEdge, gp_Pnt& curpos);
Standard_EXPORT void ComputeLinePosition (const gp_Lin& glin, gp_Pnt& pos, Standard_Real& pfirst, Standard_Real& plast);
Standard_EXPORT void ComputeCirclePosition (const gp_Circ& gcirc, gp_Pnt& pos, Standard_Real& pfirst, Standard_Real& plast);
Standard_EXPORT static Standard_Boolean ConnectedEdges (const TopoDS_Wire& aWire, const TopoDS_Vertex& aVertex, TopoDS_Edge& Edge1, TopoDS_Edge& Edge2);
TopoDS_Wire myWire;
gp_Pnt myPntAttach;
};
#include <AIS_FixRelation.lxx>
#endif // _AIS_FixRelation_HeaderFile

View File

@ -1,113 +0,0 @@
-- Created on: 1997-01-24
-- Created by: Robert COUBLANC
-- 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 GlobalStatus from AIS inherits TShared from MMgt
---Purpose: Stores information about objects in graphic context:
-- - Status Of Display : in the main viewer
-- hidden in the main viewer
-- - Displayed Modes
-- - Active Selection Modes
-- - is the Interactive Object Current ?
-- - Layer Index
uses
ListOfInteger from TColStd,
DisplayStatus from AIS,
NameOfColor from Quantity
is
Create returns GlobalStatus from AIS;
Create (aStat : DisplayStatus from AIS;
aDispMode,aSelMode: Integer from Standard;
ishilighted : Boolean from Standard=Standard_False;
TheHiCol : NameOfColor from Quantity = Quantity_NOC_WHITE;
aLayerIndex : Integer from Standard = 0)
returns GlobalStatus from AIS;
---Category: Modifications.
SetGraphicStatus(me:mutable; aStat : DisplayStatus from AIS);
---C++: inline
AddDisplayMode(me:mutable; aMode: Integer from Standard);
---C++: inline
AddSelectionMode(me:mutable; aMode : Integer from Standard);
---C++: inline
SetLayerIndex (me: mutable ; AnIndex : Integer from Standard);
---C++: inline
SetHilightStatus (me: mutable; aStat:Boolean from Standard);
---C++: inline
SetHilightColor(me:mutable;aHiCol : NameOfColor from Quantity);
---C++: inline
IsSubIntensityOn(me) returns Boolean from Standard;
---C++: inline
SubIntensityOn (me: mutable);
---C++: inline
SubIntensityOff (me: mutable);
---C++: inline
RemoveDisplayMode(me:mutable; aMode : Integer from Standard);
RemoveSelectionMode(me:mutable; aMode : Integer from Standard);
ClearSelectionModes(me:mutable);
---Category: Information.
GraphicStatus(me) returns DisplayStatus from AIS;
---C++: inline
DisplayedModes(me) returns ListOfInteger from TColStd;
---C++: return const &
---C++: inline
---Purpose: keeps the information of displayed modes in the
-- main viewer.
SelectionModes(me) returns ListOfInteger from TColStd;
---C++: return const &
---C++: inline
---Purpose: keeps the active selection modes of the object
-- in the main viewer.
IsHilighted(me) returns Boolean from Standard;
---C++: inline
HilightColor(me) returns NameOfColor from Quantity;
---C++: inline
IsDModeIn(me; aMode : Integer from Standard) returns Boolean from Standard;
IsSModeIn(me; aMode : Integer from Standard) returns Boolean from Standard;
fields
myStatus : DisplayStatus from AIS;
myDispModes : ListOfInteger from TColStd;
mySelModes : ListOfInteger from TColStd;
myLayerIndex : Integer from Standard;
myIsHilit : Boolean from Standard;
myHiCol : NameOfColor from Quantity;
mySubInt : Boolean;
end GlobalStatus;

View File

@ -14,7 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_GlobalStatus.ixx>
#include <AIS_GlobalStatus.hxx>
#include <Standard_Type.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
AIS_GlobalStatus::AIS_GlobalStatus():

View File

@ -0,0 +1,124 @@
// Created on: 1997-01-24
// Created by: Robert COUBLANC
// 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 _AIS_GlobalStatus_HeaderFile
#define _AIS_GlobalStatus_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <AIS_DisplayStatus.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Quantity_NameOfColor.hxx>
#include <MMgt_TShared.hxx>
class AIS_GlobalStatus;
DEFINE_STANDARD_HANDLE(AIS_GlobalStatus, MMgt_TShared)
//! Stores information about objects in graphic context:
//! - Status Of Display : in the main viewer
//! hidden in the main viewer
//! - Displayed Modes
//! - Active Selection Modes
//! - is the Interactive Object Current ?
//! - Layer Index
class AIS_GlobalStatus : public MMgt_TShared
{
public:
Standard_EXPORT AIS_GlobalStatus();
Standard_EXPORT AIS_GlobalStatus(const AIS_DisplayStatus aStat, const Standard_Integer aDispMode, const Standard_Integer aSelMode, const Standard_Boolean ishilighted = Standard_False, const Quantity_NameOfColor TheHiCol = Quantity_NOC_WHITE, const Standard_Integer aLayerIndex = 0);
void SetGraphicStatus (const AIS_DisplayStatus aStat);
void AddDisplayMode (const Standard_Integer aMode);
void AddSelectionMode (const Standard_Integer aMode);
void SetLayerIndex (const Standard_Integer AnIndex);
void SetHilightStatus (const Standard_Boolean aStat);
void SetHilightColor (const Quantity_NameOfColor aHiCol);
Standard_Boolean IsSubIntensityOn() const;
void SubIntensityOn();
void SubIntensityOff();
Standard_EXPORT void RemoveDisplayMode (const Standard_Integer aMode);
Standard_EXPORT void RemoveSelectionMode (const Standard_Integer aMode);
Standard_EXPORT void ClearSelectionModes();
AIS_DisplayStatus GraphicStatus() const;
//! keeps the information of displayed modes in the
//! main viewer.
const TColStd_ListOfInteger& DisplayedModes() const;
//! keeps the active selection modes of the object
//! in the main viewer.
const TColStd_ListOfInteger& SelectionModes() const;
Standard_Boolean IsHilighted() const;
Quantity_NameOfColor HilightColor() const;
Standard_EXPORT Standard_Boolean IsDModeIn (const Standard_Integer aMode) const;
Standard_EXPORT Standard_Boolean IsSModeIn (const Standard_Integer aMode) const;
DEFINE_STANDARD_RTTI(AIS_GlobalStatus,MMgt_TShared)
protected:
private:
AIS_DisplayStatus myStatus;
TColStd_ListOfInteger myDispModes;
TColStd_ListOfInteger mySelModes;
Standard_Integer myLayerIndex;
Standard_Boolean myIsHilit;
Quantity_NameOfColor myHiCol;
Standard_Boolean mySubInt;
};
#include <AIS_GlobalStatus.lxx>
#endif // _AIS_GlobalStatus_HeaderFile

View File

@ -1,67 +0,0 @@
-- Created on: 1997-02-10
-- Created by: Robert COUBLANC
-- 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 GraphicTool from AIS
---Purpose:
uses
Drawer from Prs3d,
TypeOfAttribute from AIS,
NameOfColor from Quantity,
Color from Quantity,
TypeOfLine from Aspect,
MaterialAspect from Graphic3d
is
GetLineColor(myclass; aDrawer : Drawer from Prs3d; TheTypeOfAttributes : TypeOfAttribute from AIS)
returns NameOfColor from Quantity;
GetLineColor(myclass; aDrawer : Drawer from Prs3d;
TheTypeOfAttributes : TypeOfAttribute from AIS;
TheLineColor: out Color from Quantity);
GetLineWidth(myclass; aDrawer : Drawer from Prs3d; TheTypeOfAttributes : TypeOfAttribute from AIS)
returns Real from Standard;
GetLineType (myclass; aDrawer : Drawer from Prs3d; TheTypeOfAttributes : TypeOfAttribute from AIS)
returns TypeOfLine from Aspect;
GetLineAtt(myclass;
aDrawer : Drawer from Prs3d;
TheTypeOfAttributes : TypeOfAttribute from AIS;
aCol : in out NameOfColor from Quantity;
aWidth : in out Real from Standard;
aTyp : in out TypeOfLine from Aspect);
GetInteriorColor(myclass;
aDrawer : Drawer from Prs3d)
returns NameOfColor from Quantity;
GetInteriorColor(myclass;
aDrawer : Drawer from Prs3d;
aColor: out Color from Quantity);
GetMaterial(myclass; aDrawer:Drawer from Prs3d)
returns MaterialAspect from Graphic3d;
end GraphicTool;

View File

@ -14,21 +14,20 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_GraphicTool.ixx>
#include <Quantity_Color.hxx>
#include <Prs3d_LineAspect.hxx>
#include <AIS_GraphicTool.hxx>
#include <Aspect_AspectLine.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_PlaneAspect.hxx>
#include <Prs3d_DatumAspect.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Aspect_InteriorStyle.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_MaterialAspect.hxx>
#include <Prs3d_DatumAspect.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_PlaneAspect.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Quantity_Color.hxx>
static Handle(Prs3d_LineAspect) GetLineAspect(const Handle(Prs3d_Drawer)& Dr,
const AIS_TypeOfAttribute Att)

View File

@ -0,0 +1,80 @@
// Created on: 1997-02-10
// Created by: Robert COUBLANC
// 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 _AIS_GraphicTool_HeaderFile
#define _AIS_GraphicTool_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Prs3d_Drawer.hxx>
#include <AIS_TypeOfAttribute.hxx>
#include <Standard_Real.hxx>
#include <Aspect_TypeOfLine.hxx>
class Quantity_Color;
class Graphic3d_MaterialAspect;
class AIS_GraphicTool
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT static Quantity_NameOfColor GetLineColor (const Handle(Prs3d_Drawer)& aDrawer, const AIS_TypeOfAttribute TheTypeOfAttributes);
Standard_EXPORT static void GetLineColor (const Handle(Prs3d_Drawer)& aDrawer, const AIS_TypeOfAttribute TheTypeOfAttributes, Quantity_Color& TheLineColor);
Standard_EXPORT static Standard_Real GetLineWidth (const Handle(Prs3d_Drawer)& aDrawer, const AIS_TypeOfAttribute TheTypeOfAttributes);
Standard_EXPORT static Aspect_TypeOfLine GetLineType (const Handle(Prs3d_Drawer)& aDrawer, const AIS_TypeOfAttribute TheTypeOfAttributes);
Standard_EXPORT static void GetLineAtt (const Handle(Prs3d_Drawer)& aDrawer, const AIS_TypeOfAttribute TheTypeOfAttributes, Quantity_NameOfColor& aCol, Standard_Real& aWidth, Aspect_TypeOfLine& aTyp);
Standard_EXPORT static Quantity_NameOfColor GetInteriorColor (const Handle(Prs3d_Drawer)& aDrawer);
Standard_EXPORT static void GetInteriorColor (const Handle(Prs3d_Drawer)& aDrawer, Quantity_Color& aColor);
Standard_EXPORT static Graphic3d_MaterialAspect GetMaterial (const Handle(Prs3d_Drawer)& aDrawer);
protected:
private:
};
#endif // _AIS_GraphicTool_HeaderFile

View File

@ -1,214 +0,0 @@
-- Created on: 1997-03-03
-- Created by: Jean-Pierre COMBE
-- 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 IdenticRelation from AIS inherits Relation from AIS
---Purpose: Constructs a constraint by a relation of identity
-- between two or more datums figuring in shape
-- Interactive Objects.
uses
Shape from TopoDS,
Vertex from TopoDS,
Wire from TopoDS,
Presentation from Prs3d,
PresentationManager3d from PrsMgr,
Selection from SelectMgr,
Projector from Prs3d,
Transformation from Geom,
Plane from Geom,
Curve from Geom,
Line from Geom,
Circle from Geom,
Ellipse from Geom,
Pnt from gp,
Dir from gp
is
Create(FirstShape : Shape from TopoDS;
SecondShape : Shape from TopoDS;
aPlane : Plane from Geom)
returns IdenticRelation from AIS;
---Purpose:
-- Initializes the relation of identity between the two
-- entities, FirstShape and SecondShape. The plane
-- aPlane is initialized in case a visual reference is
-- needed to show identity.
IsMovable(me) returns Boolean from Standard
---C++: inline
---Purpose:
-- Returns true if the interactive object is movable.
is redefined;
-- Methods from PresentableObject
Compute(me : mutable;
aPresentationManager: PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard= 0)
is redefined private;
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: Presentation from Prs3d)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined;
---Purpose: computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
-- Methods from SelectableObject
ComputeSelection(me : mutable;
aSelection : Selection from SelectMgr;
aMode : Integer from Standard)
is redefined private;
--
-- Computation private methods
--
ComputeOneEdgeOVertexPresentation(me: mutable;
aPresentation : Presentation from Prs3d)
is private;
ComputeTwoEdgesPresentation(me: mutable;
aPresentation : Presentation from Prs3d)
is private;
ComputeTwoLinesPresentation(me: mutable;
aPresentation : Presentation from Prs3d;
aLin : Line from Geom;
Pnt1On1 : in out Pnt from gp;
Pnt2On1 : in out Pnt from gp;
Pnt1On2 : in out Pnt from gp;
Pnt2On2 : in out Pnt from gp;
isInf1 : Boolean from Standard;
isInf2 : Boolean from Standard)
is private;
ComputeTwoCirclesPresentation(me: mutable;
aPresentation : Presentation from Prs3d;
aCircle : Circle from Geom;
Pnt1On1 : Pnt from gp;
Pnt2On1 : Pnt from gp;
Pnt1On2 : Pnt from gp;
Pnt2On2 : Pnt from gp)
is private;
-- jfa 17/10/2000
ComputeAutoArcPresentation(me: mutable;
aCircle : Circle from Geom;
firstp : Pnt from gp;
lastp : Pnt from gp;
isstatic: Boolean from Standard = Standard_False)
---Purpose: Computes the presentation of the identic constraint
-- between 2 arcs in the case of automatic presentation
is private;
ComputeNotAutoCircPresentation(me: mutable;
aCircle : Circle from Geom)
---Purpose: Computes the presentation of the identic constraint
-- between 2 circles in the case of non automatic presentation
is private;
ComputeNotAutoArcPresentation(me: mutable;
aCircle : Circle from Geom;
pntfirst: Pnt from gp;
pntlast : Pnt from gp)
---Purpose: Computes the presentation of the identic constraint
-- between 2 arcs in the case of non automatic presentation
is private;
-- jfa 17/10/2000 end
-- jfa 10/10/2000
ComputeTwoEllipsesPresentation(me: mutable;
aPrs : Presentation from Prs3d;
anEll : Ellipse from Geom;
Pnt1On1 : Pnt from gp;
Pnt2On1 : Pnt from gp;
Pnt1On2 : Pnt from gp;
Pnt2On2 : Pnt from gp)
is private;
-- jfa 10/10/2000 end
-- jfa 18/10/2000
ComputeAutoArcPresentation(me: mutable;
theEll : Ellipse from Geom;
firstp : Pnt from gp;
lastp : Pnt from gp;
isstatic: Boolean from Standard = Standard_False)
---Purpose: Computes the presentation of the identic constraint
-- between 2 arcs in the case of automatic presentation
is private;
ComputeNotAutoElipsPresentation(me: mutable;
theEll : Ellipse from Geom)
---Purpose: Computes the presentation of the identic constraint
-- between 2 ellipses in the case of non automatic presentation
is private;
ComputeNotAutoArcPresentation(me: mutable;
theEll : Ellipse from Geom;
pntfirst: Pnt from gp;
pntlast : Pnt from gp)
---Purpose: Computes the presentation of the identic constraint
-- between 2 arcs in the case of non automatic presentation
is private;
-- jfa 18/10/2000 end
ComputeTwoVerticesPresentation(me: mutable;
aPresentation : Presentation from Prs3d)
is private;
ComputeSegSize(me)
returns Real from Standard
is private;
ComputeDirection(me; aWire : Wire from TopoDS;
aVertex : Vertex from TopoDS;
aDir : out Dir from gp)
returns Boolean from Standard
is private;
ComputeLineDirection(me; aLin : Line from Geom;
anExtremity : Pnt from gp)
returns Dir from gp
is private;
ComputeCircleDirection(me; aCirc : Circle from Geom;
ConnectedVertex : Vertex from TopoDS)
returns Dir from gp
is private;
fields
isCircle : Boolean from Standard;
myFAttach : Pnt from gp;
mySAttach : Pnt from gp;
myCenter : Pnt from gp;
end IdenticRelation;

View File

@ -14,58 +14,49 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_NotImplemented.hxx>
#include <AIS_IdenticRelation.ixx>
#include <AIS.hxx>
#include <AIS_IdenticRelation.hxx>
#include <AIS_Shape.hxx>
#include <BRep_Tool.hxx>
#include <DsgPrs_IdenticPresentation.hxx>
#include <ElCLib.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_Line.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
#include <gp_Dir.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <Precision.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveCurve.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <TColStd_ListIteratorOfListOfTransient.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <StdPrs_WFDeflectionShape.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TColStd_ListIteratorOfListOfTransient.hxx>
#include <TopAbs.hxx>
#include <TopExp.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
// jfa 15/10/2000
#include <Geom_Ellipse.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
static Standard_Real Modulo2PI(const Standard_Real ANGLE)
{
if ( ANGLE < 0 ) return Modulo2PI(ANGLE + 2*M_PI);

View File

@ -0,0 +1,154 @@
// Created on: 1997-03-03
// Created by: Jean-Pierre COMBE
// 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 _AIS_IdenticRelation_HeaderFile
#define _AIS_IdenticRelation_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Boolean.hxx>
#include <gp_Pnt.hxx>
#include <AIS_Relation.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard_Real.hxx>
class TopoDS_Shape;
class Geom_Plane;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class Geom_Line;
class gp_Pnt;
class Geom_Circle;
class Geom_Ellipse;
class TopoDS_Wire;
class TopoDS_Vertex;
class gp_Dir;
class AIS_IdenticRelation;
DEFINE_STANDARD_HANDLE(AIS_IdenticRelation, AIS_Relation)
//! Constructs a constraint by a relation of identity
//! between two or more datums figuring in shape
//! Interactive Objects.
class AIS_IdenticRelation : public AIS_Relation
{
public:
//! Initializes the relation of identity between the two
//! entities, FirstShape and SecondShape. The plane
//! aPlane is initialized in case a visual reference is
//! needed to show identity.
Standard_EXPORT AIS_IdenticRelation(const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane);
//! Returns true if the interactive object is movable.
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE;
//! computes the presentation according to a point of view
//! given by <aProjector>.
//! To be Used when the associated degenerated Presentations
//! have been transformed by <aTrsf> which is not a Pure
//! Translation. The HLR Prs can't be deducted automatically
//! WARNING :<aTrsf> must be applied
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_IdenticRelation,AIS_Relation)
protected:
private:
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeOneEdgeOVertexPresentation (const Handle(Prs3d_Presentation)& aPresentation);
Standard_EXPORT void ComputeTwoEdgesPresentation (const Handle(Prs3d_Presentation)& aPresentation);
Standard_EXPORT void ComputeTwoLinesPresentation (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Geom_Line)& aLin, gp_Pnt& Pnt1On1, gp_Pnt& Pnt2On1, gp_Pnt& Pnt1On2, gp_Pnt& Pnt2On2, const Standard_Boolean isInf1, const Standard_Boolean isInf2);
Standard_EXPORT void ComputeTwoCirclesPresentation (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Geom_Circle)& aCircle, const gp_Pnt& Pnt1On1, const gp_Pnt& Pnt2On1, const gp_Pnt& Pnt1On2, const gp_Pnt& Pnt2On2);
//! Computes the presentation of the identic constraint
//! between 2 arcs in the case of automatic presentation
Standard_EXPORT void ComputeAutoArcPresentation (const Handle(Geom_Circle)& aCircle, const gp_Pnt& firstp, const gp_Pnt& lastp, const Standard_Boolean isstatic = Standard_False);
//! Computes the presentation of the identic constraint
//! between 2 circles in the case of non automatic presentation
Standard_EXPORT void ComputeNotAutoCircPresentation (const Handle(Geom_Circle)& aCircle);
//! Computes the presentation of the identic constraint
//! between 2 arcs in the case of non automatic presentation
Standard_EXPORT void ComputeNotAutoArcPresentation (const Handle(Geom_Circle)& aCircle, const gp_Pnt& pntfirst, const gp_Pnt& pntlast);
Standard_EXPORT void ComputeTwoEllipsesPresentation (const Handle(Prs3d_Presentation)& aPrs, const Handle(Geom_Ellipse)& anEll, const gp_Pnt& Pnt1On1, const gp_Pnt& Pnt2On1, const gp_Pnt& Pnt1On2, const gp_Pnt& Pnt2On2);
//! Computes the presentation of the identic constraint
//! between 2 arcs in the case of automatic presentation
Standard_EXPORT void ComputeAutoArcPresentation (const Handle(Geom_Ellipse)& theEll, const gp_Pnt& firstp, const gp_Pnt& lastp, const Standard_Boolean isstatic = Standard_False);
//! Computes the presentation of the identic constraint
//! between 2 ellipses in the case of non automatic presentation
Standard_EXPORT void ComputeNotAutoElipsPresentation (const Handle(Geom_Ellipse)& theEll);
//! Computes the presentation of the identic constraint
//! between 2 arcs in the case of non automatic presentation
Standard_EXPORT void ComputeNotAutoArcPresentation (const Handle(Geom_Ellipse)& theEll, const gp_Pnt& pntfirst, const gp_Pnt& pntlast);
Standard_EXPORT void ComputeTwoVerticesPresentation (const Handle(Prs3d_Presentation)& aPresentation);
Standard_EXPORT Standard_Real ComputeSegSize() const;
Standard_EXPORT Standard_Boolean ComputeDirection (const TopoDS_Wire& aWire, const TopoDS_Vertex& aVertex, gp_Dir& aDir) const;
Standard_EXPORT gp_Dir ComputeLineDirection (const Handle(Geom_Line)& aLin, const gp_Pnt& anExtremity) const;
Standard_EXPORT gp_Dir ComputeCircleDirection (const Handle(Geom_Circle)& aCirc, const TopoDS_Vertex& ConnectedVertex) const;
Standard_Boolean isCircle;
gp_Pnt myFAttach;
gp_Pnt mySAttach;
gp_Pnt myCenter;
};
#include <AIS_IdenticRelation.lxx>
#endif // _AIS_IdenticRelation_HeaderFile

File diff suppressed because it is too large Load Diff

View File

@ -16,44 +16,55 @@
// Modified by XAB & Serguei Dec 97 (angle &deviation coeffts)
#include <AIS_InteractiveContext.ixx>
//#include <AIS_DataMapIteratorOfDataMapOfInteractiveInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfTransient.hxx>
#include <AIS_ConnectedInteractive.hxx>
#include <AIS_DataMapIteratorOfDataMapOfILC.hxx>
#include <AIS_DataMapIteratorOfDataMapOfIOStatus.hxx>
#include <AIS_GlobalStatus.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <AIS_LocalContext.hxx>
#include <AIS_LocalStatus.hxx>
#include <Precision.hxx>
#include <AIS_Selection.hxx>
#include <AIS_DataMapIteratorOfDataMapOfIOStatus.hxx>
#include <AIS_ConnectedInteractive.hxx>
#include <AIS_MultipleConnectedInteractive.hxx>
#include <AIS_DataMapIteratorOfDataMapOfILC.hxx>
#include <AIS_GlobalStatus.hxx>
#include <AIS_MapIteratorOfMapOfInteractive.hxx>
#include <PrsMgr_ModedPresentation.hxx>
#include <Visual3d_ViewManager.hxx>
#include <Visual3d_View.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <AIS_MultipleConnectedInteractive.hxx>
#include <AIS_Selection.hxx>
#include <AIS_Shape.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <HLRBRep.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_DatumAspect.hxx>
#include <Prs3d_PlaneAspect.hxx>
#include <PrsMgr_PresentableObject.hxx>
#include <Standard_Atomic.hxx>
#include <StdSelect_ViewerSelector3d.hxx>
#include <UnitsAPI.hxx>
#include <AIS_Trihedron.hxx>
#include <Geom_Axis2Placement.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <HLRBRep.hxx>
#include <OSD_Environment.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <AIS_InteractiveObject.hxx>
#include <Precision.hxx>
#include <Prs3d_BasicAspect.hxx>
#include <Prs3d_DatumAspect.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_PlaneAspect.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <PrsMgr_ModedPresentation.hxx>
#include <PrsMgr_PresentableObject.hxx>
#include <Quantity_Color.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_OrFilter.hxx>
#include <SelectMgr_SelectionManager.hxx>
#include <Standard_Atomic.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
#include <StdSelect_ViewerSelector3d.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfTransient.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS_Shape.hxx>
#include <UnitsAPI.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>
#include <Visual3d_View.hxx>
#include <Visual3d_ViewManager.hxx>
//#include <AIS_DataMapIteratorOfDataMapOfInteractiveInteger.hxx>
namespace
{
static volatile Standard_Integer THE_AIS_INDEX_SEL = 0;

File diff suppressed because it is too large Load Diff

View File

@ -14,37 +14,45 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_InteractiveContext.jxx>
#include <SelectMgr_EntityOwner.hxx>
#include <StdSelect_ViewerSelector3d.hxx>
#include <AIS_Selection.hxx>
#include <AIS_StatusOfDetection.hxx>
#include <AIS_StatusOfPick.hxx>
#include <AIS_DataMapIteratorOfDataMapOfIOStatus.hxx>
#include <AIS_LocalContext.hxx>
#include <AIS_GlobalStatus.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_LocalContext.hxx>
#include <AIS_MapIteratorOfMapOfInteractive.hxx>
#include <AIS_MapOfInteractive.hxx>
#include <AIS_Selection.hxx>
#include <AIS_Shape.hxx>
#include <AIS_StatusOfDetection.hxx>
#include <AIS_StatusOfPick.hxx>
#include <Aspect_Grid.hxx>
#include <Prs3d_BasicAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Quantity_Color.hxx>
#include <SelectBasics_SensitiveEntity.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_OrFilter.hxx>
#include <SelectMgr_Selection.hxx>
#include <SelectMgr_SelectionManager.hxx>
#include <Standard_Transient.hxx>
#include <StdSelect_ViewerSelector3d.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS_Shape.hxx>
#include <V3d_AmbientLight.hxx>
#include <V3d_DirectionalLight.hxx>
#include <V3d_Light.hxx>
#include <V3d_PositionalLight.hxx>
#include <V3d_SpotLight.hxx>
#include <V3d_DirectionalLight.hxx>
#include <V3d_AmbientLight.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>
#include <Visual3d_View.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <SelectMgr_Selection.hxx>
#include <SelectBasics_SensitiveEntity.hxx>
#include <Prs3d_Presentation.hxx>
#include <AIS_MapOfInteractive.hxx>
#include <AIS_MapIteratorOfMapOfInteractive.hxx>
#include <AIS_InteractiveObject.hxx>
//=======================================================================
//function : MoveTo
//purpose :

View File

@ -14,28 +14,39 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_InteractiveContext.jxx>
#include <AIS_LocalContext.hxx>
#include <AIS_GlobalStatus.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <AIS_DataMapIteratorOfDataMapOfIOStatus.hxx>
#include <AIS_DataMapIteratorOfDataMapOfILC.hxx>
#include <Graphic3d_StructureManager.hxx>
#include <Graphic3d_Structure.hxx>
#include <Graphic3d_MapOfStructure.hxx>
#include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
#include <AIS_DataMapIteratorOfDataMapOfIOStatus.hxx>
#include <AIS_GlobalStatus.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_LocalContext.hxx>
#include <AIS_Selection.hxx>
#include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
#include <Graphic3d_MapOfStructure.hxx>
#include <Graphic3d_Structure.hxx>
#include <Graphic3d_StructureManager.hxx>
#include <Prs3d_BasicAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Quantity_Color.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_OrFilter.hxx>
#include <SelectMgr_SelectionManager.hxx>
#include <Standard_Transient.hxx>
#include <StdSelect_ViewerSelector3d.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS_Shape.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>
//=======================================================================
//function : OpenLocalContext
//purpose :
//=======================================================================
Standard_Integer AIS_InteractiveContext::
OpenLocalContext(const Standard_Boolean UseDisplayedObjects,
const Standard_Boolean AllowShapeDecomposition,

View File

@ -15,13 +15,28 @@
// Modified: 22/03/04 ; SAN : OCC4895 High-level interface for controlling polygon offsets
#include <AIS_InteractiveContext.jxx>
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
#include <AIS_GlobalStatus.hxx>
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_LocalContext.hxx>
#include <Prs3d_BasicAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Quantity_Color.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_OrFilter.hxx>
#include <SelectMgr_SelectionManager.hxx>
#include <Standard_Transient.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS_Shape.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
//=======================================================================
//function : SetPolygonOffsets
//purpose :

View File

@ -1,626 +0,0 @@
-- Created on: 1996-12-11
-- Created by: Robert COUBLANC
-- 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.
deferred class InteractiveObject from AIS inherits SelectableObject from SelectMgr
---Purpose:
-- Defines a class of objects with display and selection services.
-- Entities which are visualized and selected are
-- Interactive Objects. You can make use of classes of
-- standard Interactive Objects for which all necessary
-- methods have already been programmed, or you can
-- implement your own classes of Interactive Objects.
-- Specific attributes of entities such as arrow aspect for
-- dimensions must be loaded in a Drawer. This Drawer
-- is then applied to the Interactive Object in view.
-- There are four types of Interactive Object in AIS: the
-- construction element or Datum, the Relation, which
-- includes both dimensions and constraints, the Object,
-- and finally, when the object is of an unknown type, the None type.
-- Inside these categories, a signature, or index,
-- provides the possibility of additional characterization.
-- By default, the Interactive Object has a None type
-- and a signature of 0. If you want to give a particular
-- type and signature to your interactive object, you must
-- redefine the methods, Signature and Type.
-- Warning
-- In the case of attribute methods, methods for
-- standard attributes are virtual. They must be
-- redefined by the inheriting classes. Setcolor for a
-- point and Setcolor for a plane, for example, do not
-- affect the same attributes in the Drawer.
uses
Trsf from gp,
NameOfColor from Quantity,
Color from Quantity,
Ratio from Quantity,
ListOfTransient from TColStd,
ListOfInteger from TColStd,
Box from Bnd,
NameOfMaterial from Graphic3d,
MaterialAspect from Graphic3d,
PToContext from AIS,
TypeOfPresentation3d from PrsMgr,
InteractiveContext from AIS,
KindOfInteractive from AIS,
TypeOfFacingModel from Aspect,
Transformation from Geom,
Presentation from Prs3d,
BasicAspect from Prs3d,
-- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
PresentationManager from PrsMgr,
Presentation from PrsMgr
-- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
is
Initialize (aTypeOfPresentation3d: TypeOfPresentation3d from PrsMgr = PrsMgr_TOP_AllView) ;
---Purpose: The TypeOfPresention3d means that the interactive object
-- may have a presentation dependant of the view of Display
---Category: Virtual methods to be redefined...
Type (me) returns KindOfInteractive from AIS is virtual;
---Purpose:
-- Returns the kind of Interactive Object:
-- - None
-- - Datum
-- - Relation
-- - Object
-- By default, the interactive object has a None type.
-- Because specific shapes entail different behavior
-- according to their sub-shapes, you may need to
-- create a Local Context. This will allow you to
-- specify the additional characteristics which you
-- need to handle these shapes.
Signature(me) returns Integer from Standard is virtual;
---Purpose: Specifies additional characteristics of Interactive
-- Objects. A signature is, in fact, an index with integer
-- values assigned different properties.
-- This method is frequently used in conjuction with
-- Type to give a particular type and signature to an
-- Interactive Object. By default, the Interactive Object
-- has a None type and a signature of 0. Among the
-- datums, this signature is attributed to the shape
-- The remaining datums have the following default signatures:
-- - Point signature 1
-- - Axis signature 2
-- - Trihedron signature 3
-- - PlaneTrihedron signature 4
-- - Line signature 5
-- - Circle signature 6
-- - Plane signature 7.
AcceptShapeDecomposition(me) returns Boolean from Standard is virtual;
---C++: inline
---Purpose: Informs the graphic context that the interactive Object
-- may be decomposed into sub-shapes for dynamic selection.
-- The most used Interactive Object is AIS_Shape.
-- Activation methods for standard selection modes are
-- proposed in the Interactive Context. These include
-- selection by vertex or by edges. For datums with the
-- same behavior as AIS_Shape, such as vetices and
-- edges, we must redefine the virtual method so that
-- AcceptShapeDecomposition returns false.
-- Rule for selection :
-- Mode 0 : Selection of the interactive Object itself
-- Mode 1 : Selection of vertices
-- Mode 2 : Selection Of Edges
-- Mode 3 : Selection Of Wires
-- Mode 4 : Selection Of Faces ...
SetCurrentFacingModel(me: mutable;
aModel: TypeOfFacingModel from Aspect = Aspect_TOFM_BOTH_SIDE);
---Purpose: change the current facing model apply on polygons for
-- SetColor(), SetTransparency(), SetMaterial() methods
-- default facing model is Aspect_TOFM_TWO_SIDE. This mean that attributes is
-- applying both on the front and back face.
CurrentFacingModel(me) returns TypeOfFacingModel from Aspect;
---Purpose: Returns the current facing model which is in effect.
SetColor(me:mutable;aColor:Color from Quantity) is virtual;
SetColor(me:mutable;aColor:NameOfColor from Quantity) is virtual;
---Purpose: only the interactive obj knowns which Drawer attribute
-- is affected by the color (ex: for a wire, it's the
-- wireaspect field of the drawer, but for a vertex, only
-- the point aspect field is affected by the color)
-- WARNING : Do not forget to set the corresponding fields
-- here (hasOwnColor and myOwnColor)
UnsetColor(me:mutable) is virtual;
---Purpose: Removes color settings. Only the Interactive Object
-- knows which Drawer attribute is affected by the color
-- setting. For a wire, for example, wire aspect is the
-- attribute affected. For a vertex, however, only point
-- aspect is affected by the color setting.
SetWidth(me:mutable; aValue:Real from Standard) is virtual;
---Purpose: Allows you to provide the setting aValue for width.
-- Only the Interactive Object knows which Drawer
-- attribute is affected by the width setting.
UnsetWidth(me:mutable) is virtual;
AcceptDisplayMode(me;aMode:Integer from Standard) returns Boolean from Standard is virtual;
---Purpose: Returns true if the class of objects accepts the display mode aMode.
-- The interactive context can have a default mode of
-- representation for the set of Interactive Objects. This
-- mode may not be accepted by a given class of
-- objects. Consequently, this virtual method allowing us
-- to get information about the class in question must be implemented.
DefaultDisplayMode(me) returns Integer from Standard is virtual;
---Purpose: Returns the default display mode. This method is to
-- be implemented when the main mode is not mode 0.
Redisplay (me:mutable; AllModes:Boolean from Standard =Standard_False);
---Purpose: Updates the active presentation; if <AllModes> = Standard_True
-- all the presentations inside are recomputed.
-- IMPORTANT: It is preferable to call Redisplay method of
-- corresponding AIS_InteractiveContext instance for cases when it
-- is accessible. This method just redirects call to myCTXPtr,
-- so this class field must be up to date for proper result.
SetInfiniteState(me:mutable;aFlag:Boolean from Standard = Standard_True);
---Purpose: Sets the infinite state flag aFlage.
-- if <aFlag> = True , the interactiveObject is
-- considered as infinite, i.e. its graphic presentations
-- are not taken in account for View FitAll...
IsInfinite(me) returns Boolean from Standard;
---C++: inline
---Purpose:
-- Returns true if the interactive object is infinite. In this
-- case, its graphic presentations are not taken into
-- account in the fit-all view.
---Category: Link To InteractiveContext
HasInteractiveContext(me) returns Boolean from Standard;
---Purpose: Indicates whether the Interactive Object has a pointer
-- to an interactive context.
GetContext(me) returns InteractiveContext from AIS;
---Purpose: Returns the context pointer to the interactive context.
SetContext(me:mutable; aCtx : InteractiveContext from AIS) is virtual;
---Purpose: Sets the interactive context aCtx and provides a link
-- to the default drawing tool or "Drawer" if there is none.
HasOwner (me) returns Boolean from Standard;
---Purpose: Returns true if the object has an owner attributed to it.
-- The owner can be a shape for a set of sub-shapes or
-- a sub-shape for sub-shapes which it is composed of,
-- and takes the form of a transient.
GetOwner (me) returns any Transient from Standard;
---Purpose: Returns the owner of the Interactive Object.
-- The owner can be a shape for a set of sub-shapes or
-- a sub-shape for sub-shapes which it is composed of,
-- and takes the form of a transient.
-- There are two types of owners:
-- - Direct owners, decomposition shapes such as
-- edges, wires, and faces.
-- - Users, presentable objects connecting to sensitive
-- primitives, or a shape which has been decomposed.
---C++: inline
---C++: return const&
SetOwner (me : mutable;
ApplicativeEntity : Transient from Standard);
---Purpose: Allows you to attribute the owner ApplicativeEntity to
-- an Interactive Object. This can be a shape for a set of
-- sub-shapes or a sub-shape for sub-shapes which it
-- is composed of. The owner takes the form of a transient.
---C++: inline
ClearOwner(me:mutable);
---Purpose: Each Interactive Object has methods which allow us
-- to attribute an Owner to it in the form of a Transient.
-- This method removes the owner from the graphic entity.
HasUsers(me) returns Boolean from Standard;
Users(me) returns ListOfTransient from TColStd;
---C++: inline
---C++: return const&
AddUser(me:mutable; aUser : Transient from Standard);
ClearUsers(me:mutable);
---Category: "STANDARD" LOCAL ATTRIBUTES :
--
-- -Local DisplayMode
-- -Color
-- -width of lines or points
-- -typeOfLine or Marker Aspect
-- -material name (if needed)
-- -transparency (if needed)
--
-- Specific attributes of entities (such as
-- arrow aspect for dimensions) must be
-- loaded in a Drawer; this drawer is then
-- applied to InteractiveObject WARNING :
-- Here the Methods for standard attributes
-- are virtual and do nothing they must be
-- redefined by the inheriting classes
-- (setcolor for a point and setcolor for a plane
-- don't affect the same attributes in the Drawer)
HasDisplayMode (me)
returns Boolean from Standard;
---Purpose:
-- Returns true if the Interactive Object has a display
-- mode setting. Otherwise, it is displayed in Neutral Point.
---C++: inline
SetDisplayMode(me : mutable; aMode : Integer from Standard);
---Purpose: Sets the display mode aMode for the interactive object.
-- An object can have its own temporary display mode,
-- which is different from that proposed by the interactive context.
-- The range of possibilities currently proposed is the following:
-- - AIS_WireFrame
-- - AIS_Shaded
-- This range can, however, be extended through the creation of new display modes.
UnsetDisplayMode(me : mutable);
---Purpose: Removes display mode settings from the interactive object.
---C++: inline
DisplayMode(me)
returns Integer;
---C++: inline
---Purpose: Returns the display mode setting of the Interactive Object.
-- The range of possibilities is the following:
-- - AIS_WireFrame
-- - AIS_Shaded
-- This range can, however, be extended through the
-- creation of new display modes.
HasSelectionMode(me) returns Boolean from Standard;
---Purpose: Allows you to change the selection mode of an
-- Interactive Object.
-- The default selection mode setting is 0.
-- For shapes, for example, the selection modes are as follows:
-- - mode 0 - selection of the shape itself
-- - mode 1 - selection of vertices
-- - mode 2 - selection of edges
-- - mode 3 - selection of wires
-- - mode 4 - selection of faces
-- - mode 5 - selection of shells
-- - mode 6 - selection of solids
-- - mode 7 - selection of compounds
-- For trihedra, on the other hand, the selection modes are the following four:
-- - mode 0 - selection of a trihedron
-- - mode 1 - selection of its origin
-- - mode 2 - selection of its axes
-- - mode 3 - selection of its planes
SelectionMode(me) returns Integer from Standard;
---Purpose: Returns the selection mode of the interactive object.
SetSelectionMode(me:mutable; aMode: Integer from Standard);
---Purpose: You can change the default selection mode index
-- aMode of an Interactive Object.
-- This is only of interest if you decide that mode 0
-- adopted by convention will not do.
UnsetSelectionMode(me:mutable);
---Purpose: You can change the default selection mode index of
-- an Interactive Object.
-- This is only of interest if you decide that the 0 mode
-- adopted by convention will not do.
---C++: inline
SelectionPriority(me) returns Integer from Standard;
---C++: inline
---Purpose: Returns the selection priority setting. -1 indicates that there is none.
-- You can modify the selection priority of an owner to
-- make one entity more selectionable than another one.
-- The default selection priority for an owner is 5, for
-- example. To increase selection priority, choose a
-- setting between 5 and 10. An entity with priority 7 will
-- take priority over one with a setting of 6 if both
-- objects are selected at the same time.
-- You could give vertices priority 8, edges priority 7,
-- faces priority 6, and shapes priority 5. If a vertex, an
-- edge and a face are simultaneously detected during
-- selection, only the vertex will then be highlighted.
-- For trihedra, for example, the default priorities are the following four:
-- - priority 1 - a trihedron
-- - priority 5 - its origin
-- - priority 3 - its axes
-- - priority 2 - its planes
SetSelectionPriority(me:mutable; aPriority : Integer from Standard);
---C++: inline
---Purpose: Allows you to provide a setting aPriority for selection priority.
-- You can modify selection priority of an owner to make
-- one entity more selectionable than another one. The
-- default selection priority for an owner is 5, for
-- example. To increase selection priority, choose a
-- setting between 5 and 10. An entity with priority 7 will
-- take priority over one with a setting of 6.
UnsetSelectionPriority(me:mutable);
---C++: inline
---Purpose: Removes the setting for selection priority. SelectionPriority then returns -1.
HasSelectionPriority(me) returns Boolean from Standard;
---C++: inline
---Purpose: Returns true if there is a setting for selection priority.
-- You can modify selection priority of an owner to make
-- one entity more selectionable than another one. The
-- default selection priority for an owner is 5, for
-- example. To increase selection priority, choose a
-- setting between 5 and 10. An entity with priority 7 will
-- take priority over one with a setting of 6.
HasHilightMode(me) returns Boolean from Standard;
---C++: inline
---Purpose: Returns true if the Interactive Object is in highlight mode.
HilightMode(me) returns Integer from Standard ;
---C++: inline
---Purpose: Returns the setting for highlight mode.
-- At dynamic detection, the presentation echoed by the
-- Interactive Context, is by default the presentation
-- already on the screen. You can specify a Highlight
-- presentation mode which is valid no matter what the
-- active representation of the object. It makes no
-- difference whether this choice is temporary or
-- definitive. To do this, we use the following functions:
-- - SetHilightMode
-- - UnSetHilightMode
-- In the case of a shape, whether it is visualized in
-- wireframe presentation or with shading, we want to
-- systematically highlight the wireframe presentation.
-- Consequently, we set the highlight mode to 0.
SetHilightMode(me:mutable;anIndex : Integer from Standard);
---C++: inline
---Purpose: Sets the highlight mode anIndex for the interactive object.
-- If, for example, you want to systematically highlight
-- the wireframe presentation of a shape - whether
-- visualized in wireframe presentation or with shading -
-- you set the highlight mode to 0.
UnsetHilightMode(me:mutable);
---C++: inline
---Purpose: Allows the user to take a given Prs for hilight
-- ex : for a shape which would be displayed in shading mode
-- the hilight Prs is the wireframe mode.
-- if No specific hilight mode is defined, the displayed Prs
-- will be the hilighted one.
HasColor (me) returns Boolean from Standard;
---C++: inline
---Purpose: Returns true if the Interactive Object has color.
Color(me) returns NameOfColor from Quantity is virtual;
---C++: inline
---Purpose: Returns the color setting of the Interactive Object.
Color(me; aColor: out Color from Quantity) is virtual;
---C++: inline
HasWidth(me) returns Boolean from Standard;
---C++: inline
---Purpose: Returns true if the Interactive Object has width.
Width(me) returns Real from Standard ;
--- Purpose: Returns the width setting of the Interactive Object.
HasMaterial(me) returns Boolean from Standard ;
---Purpose: Returns true if the Interactive Object has a setting for material.
Material(me) returns NameOfMaterial from Graphic3d is virtual;
---Purpose: Returns the current material setting.
-- This will be on of the following materials:
-- - Brass
-- - Bronze
-- - Gold
-- - Pewter
-- - Silver
-- - Stone.
SetMaterial(me:mutable;aName:NameOfMaterial from Graphic3d) is virtual;
---Purpose: Sets the name aName for material defining this
-- display attribute for the interactive object.
-- Material aspect determines shading aspect, color and
-- transparency of visible entities.
SetMaterial(me:mutable;aName:MaterialAspect from Graphic3d) is virtual;
--- Purpose: Sets the material aMat defining this display attribute
-- for the interactive object.
-- Material aspect determines shading aspect, color and
-- transparency of visible entities.
UnsetMaterial(me:mutable) is virtual;
---Purpose: Removes the setting for material.
SetTransparency(me:mutable;aValue : Real from Standard=0.6) is virtual;
---Purpose: Attributes a setting aValue for transparency.
-- The transparency value should be between 0.0 and 1.0.
-- At 0.0 an object will be totally opaque, and at 1.0, fully transparent.
-- Warning At a value of 1.0, there may be nothing visible.
IsTransparent(me) returns Boolean from Standard;
---C++: inline
---Purpose: Returns true if there is a transparency setting.
Transparency(me) returns Real from Standard is virtual;
---Purpose: Returns the transparency setting.
-- This will be between 0.0 and 1.0.
-- At 0.0 an object will be totally opaque, and at 1.0, fully transparent.
UnsetTransparency(me:mutable) is virtual;
---Purpose: Removes the transparency setting. The object is opaque by default.
UnsetAttributes(me:mutable) is redefined virtual;
---Purpose: Clears settings provided by the drawing tool aDrawer.
---Category: information about Prs to be recomputed
-- after local attributes change... to be removed...
RecomputeEveryPrs(me) returns Boolean is virtual private;
MustRecomputePrs(me;aMode : Integer from Standard) is private;
ListOfRecomputeModes(me)returns ListOfInteger from TColStd is private;
---C++: return const&
SetRecomputeOk(me:mutable) is private;
State(me:mutable;theState: Integer from Standard) ;
---C++: inline
State(me) returns Integer from Standard ;
---C++: inline
HasPresentation ( me ) returns Boolean from Standard
is static;
---Level: Public
---Purpose: Returns TRUE when this object has a presentation
-- in the current DisplayMode()
---Category: Inquire transformation method
Presentation ( me ) returns Presentation from Prs3d
is static;
---Level: Public
---Purpose: Returns the current presentation of this object
-- according to the current DisplayMode()
---Category: Inquire transformation method
SetAspect ( me : mutable; anAspect: any BasicAspect from Prs3d;
globalChange: Boolean from Standard = Standard_True)
is static;
---Level: Public
---Purpose: Sets the graphic basic aspect to the current presentation.
-- When <globalChange> is TRUE , the full object presentation
-- is changed.
-- When <globalChange> is FALSE , only the current group
-- of the object presentation is changed.
---Category: Graphic attributes management
-- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
SetPolygonOffsets ( me : mutable;
aMode : Integer from Standard;
aFactor : ShortReal from Standard = 1.0;
aUnits : ShortReal from Standard = 0.0 ) is virtual;
---Level: Public
---Purpose: Sets up polygon offsets for this object.
-- It modifies all existing presentations of <anObj> (if any),
-- so it is reasonable to call this method after <anObj> has been displayed.
-- Otherwise, Compute() method should pass Graphic3d_AspectFillArea3d
-- aspect from <myDrawer> to Graphic3d_Group to make polygon offsets work.
--
-- <aMode> parameter can contain various combinations of
-- Aspect_PolygonOffsetMode enumeration elements (Aspect_POM_None means
-- that polygon offsets are not changed).
-- If <aMode> is different from Aspect_POM_Off and Aspect_POM_None, then <aFactor> and <aUnits>
-- arguments are used by graphic renderer to calculate a depth offset value:
--
-- offset = <aFactor> * m + <aUnits> * r, where
-- m - maximum depth slope for the polygon currently being displayed,
-- r - minimum window coordinates depth resolution (implementation-specific).
--
-- Deafult settings for OCC 3D viewer: mode = Aspect_POM_Fill, factor = 1., units = 0.
--
-- Negative offset values move polygons closer to the viewport,
-- while positive values shift polygons away.
-- Consult OpenGL reference for details (glPolygonOffset function description).
--
-- NOTE: This method has a side effect - it creates own shading aspect
-- if not yet created, so it is better to set up object material,
-- color, etc. first.
---Category: Graphic attributes management
HasPolygonOffsets ( me )
returns Boolean from Standard
is virtual;
---Level: Public
---Purpose: Returns Standard_True if <myDrawer> has non-null shading aspect
---Category: Inquire methods
PolygonOffsets ( me;
aMode : out Integer from Standard;
aFactor : out ShortReal from Standard;
aUnits : out ShortReal from Standard ) is virtual;
---Level: Public
---Purpose: Retrieves current polygon offsets settings from <myDrawer>.
---Category: Inquire methods
BoundingBox (me : mutable;
theBndBox : out Box from Bnd)
is redefined;
---Level: Public
---Purpose: Returns bounding box of object correspondingly to its current display mode.
fields
myCTXPtr : PToContext from AIS;
-- The reference to applicative World...
myOwner : Transient from Standard;
myUsers : ListOfTransient from TColStd;
-- The Information Fields
myTransparency : Real from Standard is protected;
myOwnColor : Color from Quantity is protected;
myOwnMaterial : NameOfMaterial from Graphic3d is protected;
---myOwnMaterial : NameOfPhysicalMaterial from Graphic3d is protected;
mySelPriority : Integer from Standard;
myDisplayMode : Integer from Standard ;
mySelectionMode : Integer from Standard;
myHilightMode : Integer from Standard is protected;
myOwnWidth : Real from Standard is protected;
myInfiniteState : Boolean from Standard is protected;
hasOwnColor : Boolean from Standard is protected;
hasOwnMaterial : Boolean from Standard is protected ;
myCurrentFacingModel: TypeOfFacingModel from Aspect is protected;
-- the management field (to be removed)...
myRecomputeEveryPrs : Boolean from Standard is protected;
myToRecomputeModes : ListOfInteger from TColStd is protected;
mystate : Integer from Standard;
friends
class InteractiveContext from AIS
end InteractiveObject;

View File

@ -16,19 +16,11 @@
// Modified : 22/03/04 ; SAN : OCC4895 High-level interface for controlling polygon offsets
#include <AIS_InteractiveObject.ixx>
#include <Aspect_PolygonOffsetMode.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Prs3d_TextAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Root.hxx>
#include <PrsMgr_ModedPresentation.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <AIS_GraphicTool.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <Aspect_PolygonOffsetMode.hxx>
#include <Bnd_Box.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
@ -36,14 +28,26 @@
#include <Graphic3d_BndBox4f.hxx>
#include <Graphic3d_CStructure.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_MaterialAspect.hxx>
#include <Graphic3d_Structure.hxx>
#include <Prs3d_BasicAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Prs3d_TextAspect.hxx>
#include <PrsMgr_ModedPresentation.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Quantity_Color.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
//=======================================================================
//function : AIS_InteractiveObject
//purpose :
//=======================================================================
AIS_InteractiveObject::
AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d):
SelectMgr_SelectableObject(aTypeOfPresentation3d),

View File

@ -0,0 +1,546 @@
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// 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 _AIS_InteractiveObject_HeaderFile
#define _AIS_InteractiveObject_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <AIS_PToContext.hxx>
#include <TColStd_ListOfTransient.hxx>
#include <Standard_Real.hxx>
#include <Quantity_Color.hxx>
#include <Graphic3d_NameOfMaterial.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Aspect_TypeOfFacingModel.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <SelectMgr_SelectableObject.hxx>
#include <PrsMgr_TypeOfPresentation3d.hxx>
#include <AIS_KindOfInteractive.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Standard_ShortReal.hxx>
class Standard_Transient;
class AIS_InteractiveContext;
class Quantity_Color;
class Graphic3d_MaterialAspect;
class Prs3d_Presentation;
class Prs3d_BasicAspect;
class Bnd_Box;
class AIS_InteractiveObject;
DEFINE_STANDARD_HANDLE(AIS_InteractiveObject, SelectMgr_SelectableObject)
//! Defines a class of objects with display and selection services.
//! Entities which are visualized and selected are
//! Interactive Objects. You can make use of classes of
//! standard Interactive Objects for which all necessary
//! methods have already been programmed, or you can
//! implement your own classes of Interactive Objects.
//! Specific attributes of entities such as arrow aspect for
//! dimensions must be loaded in a Drawer. This Drawer
//! is then applied to the Interactive Object in view.
//! There are four types of Interactive Object in AIS: the
//! construction element or Datum, the Relation, which
//! includes both dimensions and constraints, the Object,
//! and finally, when the object is of an unknown type, the None type.
//! Inside these categories, a signature, or index,
//! provides the possibility of additional characterization.
//! By default, the Interactive Object has a None type
//! and a signature of 0. If you want to give a particular
//! type and signature to your interactive object, you must
//! redefine the methods, Signature and Type.
//! Warning
//! In the case of attribute methods, methods for
//! standard attributes are virtual. They must be
//! redefined by the inheriting classes. Setcolor for a
//! point and Setcolor for a plane, for example, do not
//! affect the same attributes in the Drawer.
class AIS_InteractiveObject : public SelectMgr_SelectableObject
{
public:
//! Returns the kind of Interactive Object:
//! - None
//! - Datum
//! - Relation
//! - Object
//! By default, the interactive object has a None type.
//! Because specific shapes entail different behavior
//! according to their sub-shapes, you may need to
//! create a Local Context. This will allow you to
//! specify the additional characteristics which you
//! need to handle these shapes.
Standard_EXPORT virtual AIS_KindOfInteractive Type() const;
//! Specifies additional characteristics of Interactive
//! Objects. A signature is, in fact, an index with integer
//! values assigned different properties.
//! This method is frequently used in conjuction with
//! Type to give a particular type and signature to an
//! Interactive Object. By default, the Interactive Object
//! has a None type and a signature of 0. Among the
//! datums, this signature is attributed to the shape
//! The remaining datums have the following default signatures:
//! - Point signature 1
//! - Axis signature 2
//! - Trihedron signature 3
//! - PlaneTrihedron signature 4
//! - Line signature 5
//! - Circle signature 6
//! - Plane signature 7.
Standard_EXPORT virtual Standard_Integer Signature() const;
//! Informs the graphic context that the interactive Object
//! may be decomposed into sub-shapes for dynamic selection.
//! The most used Interactive Object is AIS_Shape.
//! Activation methods for standard selection modes are
//! proposed in the Interactive Context. These include
//! selection by vertex or by edges. For datums with the
//! same behavior as AIS_Shape, such as vetices and
//! edges, we must redefine the virtual method so that
//! AcceptShapeDecomposition returns false.
//! Rule for selection :
//! Mode 0 : Selection of the interactive Object itself
//! Mode 1 : Selection of vertices
//! Mode 2 : Selection Of Edges
//! Mode 3 : Selection Of Wires
//! Mode 4 : Selection Of Faces ...
virtual Standard_Boolean AcceptShapeDecomposition() const;
//! change the current facing model apply on polygons for
//! SetColor(), SetTransparency(), SetMaterial() methods
//! default facing model is Aspect_TOFM_TWO_SIDE. This mean that attributes is
//! applying both on the front and back face.
Standard_EXPORT void SetCurrentFacingModel (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
//! Returns the current facing model which is in effect.
Standard_EXPORT Aspect_TypeOfFacingModel CurrentFacingModel() const;
Standard_EXPORT virtual void SetColor (const Quantity_Color& aColor);
//! only the interactive obj knowns which Drawer attribute
//! is affected by the color (ex: for a wire, it's the
//! wireaspect field of the drawer, but for a vertex, only
//! the point aspect field is affected by the color)
//! WARNING : Do not forget to set the corresponding fields
//! here (hasOwnColor and myOwnColor)
Standard_EXPORT virtual void SetColor (const Quantity_NameOfColor aColor);
//! Removes color settings. Only the Interactive Object
//! knows which Drawer attribute is affected by the color
//! setting. For a wire, for example, wire aspect is the
//! attribute affected. For a vertex, however, only point
//! aspect is affected by the color setting.
Standard_EXPORT virtual void UnsetColor();
//! Allows you to provide the setting aValue for width.
//! Only the Interactive Object knows which Drawer
//! attribute is affected by the width setting.
Standard_EXPORT virtual void SetWidth (const Standard_Real aValue);
Standard_EXPORT virtual void UnsetWidth();
//! Returns true if the class of objects accepts the display mode aMode.
//! The interactive context can have a default mode of
//! representation for the set of Interactive Objects. This
//! mode may not be accepted by a given class of
//! objects. Consequently, this virtual method allowing us
//! to get information about the class in question must be implemented.
Standard_EXPORT virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const;
//! Returns the default display mode. This method is to
//! be implemented when the main mode is not mode 0.
Standard_EXPORT virtual Standard_Integer DefaultDisplayMode() const;
//! Updates the active presentation; if <AllModes> = Standard_True
//! all the presentations inside are recomputed.
//! IMPORTANT: It is preferable to call Redisplay method of
//! corresponding AIS_InteractiveContext instance for cases when it
//! is accessible. This method just redirects call to myCTXPtr,
//! so this class field must be up to date for proper result.
Standard_EXPORT void Redisplay (const Standard_Boolean AllModes = Standard_False);
//! Sets the infinite state flag aFlage.
//! if <aFlag> = True , the interactiveObject is
//! considered as infinite, i.e. its graphic presentations
//! are not taken in account for View FitAll...
Standard_EXPORT void SetInfiniteState (const Standard_Boolean aFlag = Standard_True);
//! Returns true if the interactive object is infinite. In this
//! case, its graphic presentations are not taken into
//! account in the fit-all view.
Standard_Boolean IsInfinite() const;
//! Indicates whether the Interactive Object has a pointer
//! to an interactive context.
Standard_EXPORT Standard_Boolean HasInteractiveContext() const;
//! Returns the context pointer to the interactive context.
Standard_EXPORT Handle(AIS_InteractiveContext) GetContext() const;
//! Sets the interactive context aCtx and provides a link
//! to the default drawing tool or "Drawer" if there is none.
Standard_EXPORT virtual void SetContext (const Handle(AIS_InteractiveContext)& aCtx);
//! Returns true if the object has an owner attributed to it.
//! The owner can be a shape for a set of sub-shapes or
//! a sub-shape for sub-shapes which it is composed of,
//! and takes the form of a transient.
Standard_EXPORT Standard_Boolean HasOwner() const;
//! Returns the owner of the Interactive Object.
//! The owner can be a shape for a set of sub-shapes or
//! a sub-shape for sub-shapes which it is composed of,
//! and takes the form of a transient.
//! There are two types of owners:
//! - Direct owners, decomposition shapes such as
//! edges, wires, and faces.
//! - Users, presentable objects connecting to sensitive
//! primitives, or a shape which has been decomposed.
const Handle(Standard_Transient)& GetOwner() const;
//! Allows you to attribute the owner ApplicativeEntity to
//! an Interactive Object. This can be a shape for a set of
//! sub-shapes or a sub-shape for sub-shapes which it
//! is composed of. The owner takes the form of a transient.
void SetOwner (const Handle(Standard_Transient)& ApplicativeEntity);
//! Each Interactive Object has methods which allow us
//! to attribute an Owner to it in the form of a Transient.
//! This method removes the owner from the graphic entity.
Standard_EXPORT void ClearOwner();
Standard_EXPORT Standard_Boolean HasUsers() const;
const TColStd_ListOfTransient& Users() const;
Standard_EXPORT void AddUser (const Handle(Standard_Transient)& aUser);
Standard_EXPORT void ClearUsers();
//! Returns true if the Interactive Object has a display
//! mode setting. Otherwise, it is displayed in Neutral Point.
Standard_Boolean HasDisplayMode() const;
//! Sets the display mode aMode for the interactive object.
//! An object can have its own temporary display mode,
//! which is different from that proposed by the interactive context.
//! The range of possibilities currently proposed is the following:
//! - AIS_WireFrame
//! - AIS_Shaded
//! This range can, however, be extended through the creation of new display modes.
Standard_EXPORT void SetDisplayMode (const Standard_Integer aMode);
//! Removes display mode settings from the interactive object.
void UnsetDisplayMode();
//! Returns the display mode setting of the Interactive Object.
//! The range of possibilities is the following:
//! - AIS_WireFrame
//! - AIS_Shaded
//! This range can, however, be extended through the
//! creation of new display modes.
Standard_Integer DisplayMode() const;
//! Allows you to change the selection mode of an
//! Interactive Object.
//! The default selection mode setting is 0.
//! For shapes, for example, the selection modes are as follows:
//! - mode 0 - selection of the shape itself
//! - mode 1 - selection of vertices
//! - mode 2 - selection of edges
//! - mode 3 - selection of wires
//! - mode 4 - selection of faces
//! - mode 5 - selection of shells
//! - mode 6 - selection of solids
//! - mode 7 - selection of compounds
//! For trihedra, on the other hand, the selection modes are the following four:
//! - mode 0 - selection of a trihedron
//! - mode 1 - selection of its origin
//! - mode 2 - selection of its axes
//! - mode 3 - selection of its planes
Standard_EXPORT Standard_Boolean HasSelectionMode() const;
//! Returns the selection mode of the interactive object.
Standard_EXPORT Standard_Integer SelectionMode() const;
//! You can change the default selection mode index
//! aMode of an Interactive Object.
//! This is only of interest if you decide that mode 0
//! adopted by convention will not do.
Standard_EXPORT void SetSelectionMode (const Standard_Integer aMode);
//! You can change the default selection mode index of
//! an Interactive Object.
//! This is only of interest if you decide that the 0 mode
//! adopted by convention will not do.
void UnsetSelectionMode();
//! Returns the selection priority setting. -1 indicates that there is none.
//! You can modify the selection priority of an owner to
//! make one entity more selectionable than another one.
//! The default selection priority for an owner is 5, for
//! example. To increase selection priority, choose a
//! setting between 5 and 10. An entity with priority 7 will
//! take priority over one with a setting of 6 if both
//! objects are selected at the same time.
//! You could give vertices priority 8, edges priority 7,
//! faces priority 6, and shapes priority 5. If a vertex, an
//! edge and a face are simultaneously detected during
//! selection, only the vertex will then be highlighted.
//! For trihedra, for example, the default priorities are the following four:
//! - priority 1 - a trihedron
//! - priority 5 - its origin
//! - priority 3 - its axes
//! - priority 2 - its planes
Standard_Integer SelectionPriority() const;
//! Allows you to provide a setting aPriority for selection priority.
//! You can modify selection priority of an owner to make
//! one entity more selectionable than another one. The
//! default selection priority for an owner is 5, for
//! example. To increase selection priority, choose a
//! setting between 5 and 10. An entity with priority 7 will
//! take priority over one with a setting of 6.
void SetSelectionPriority (const Standard_Integer aPriority);
//! Removes the setting for selection priority. SelectionPriority then returns -1.
void UnsetSelectionPriority();
//! Returns true if there is a setting for selection priority.
//! You can modify selection priority of an owner to make
//! one entity more selectionable than another one. The
//! default selection priority for an owner is 5, for
//! example. To increase selection priority, choose a
//! setting between 5 and 10. An entity with priority 7 will
//! take priority over one with a setting of 6.
Standard_Boolean HasSelectionPriority() const;
//! Returns true if the Interactive Object is in highlight mode.
Standard_Boolean HasHilightMode() const;
//! Returns the setting for highlight mode.
//! At dynamic detection, the presentation echoed by the
//! Interactive Context, is by default the presentation
//! already on the screen. You can specify a Highlight
//! presentation mode which is valid no matter what the
//! active representation of the object. It makes no
//! difference whether this choice is temporary or
//! definitive. To do this, we use the following functions:
//! - SetHilightMode
//! - UnSetHilightMode
//! In the case of a shape, whether it is visualized in
//! wireframe presentation or with shading, we want to
//! systematically highlight the wireframe presentation.
//! Consequently, we set the highlight mode to 0.
Standard_Integer HilightMode() const;
//! Sets the highlight mode anIndex for the interactive object.
//! If, for example, you want to systematically highlight
//! the wireframe presentation of a shape - whether
//! visualized in wireframe presentation or with shading -
//! you set the highlight mode to 0.
void SetHilightMode (const Standard_Integer anIndex);
//! Allows the user to take a given Prs for hilight
//! ex : for a shape which would be displayed in shading mode
//! the hilight Prs is the wireframe mode.
//! if No specific hilight mode is defined, the displayed Prs
//! will be the hilighted one.
void UnsetHilightMode();
//! Returns true if the Interactive Object has color.
Standard_Boolean HasColor() const;
//! Returns the color setting of the Interactive Object.
virtual Quantity_NameOfColor Color() const;
virtual void Color (Quantity_Color& aColor) const;
//! Returns true if the Interactive Object has width.
Standard_Boolean HasWidth() const;
//! Returns the width setting of the Interactive Object.
Standard_EXPORT Standard_Real Width() const;
//! Returns true if the Interactive Object has a setting for material.
Standard_EXPORT Standard_Boolean HasMaterial() const;
//! Returns the current material setting.
//! This will be on of the following materials:
//! - Brass
//! - Bronze
//! - Gold
//! - Pewter
//! - Silver
//! - Stone.
Standard_EXPORT virtual Graphic3d_NameOfMaterial Material() const;
//! Sets the name aName for material defining this
//! display attribute for the interactive object.
//! Material aspect determines shading aspect, color and
//! transparency of visible entities.
Standard_EXPORT virtual void SetMaterial (const Graphic3d_NameOfMaterial aName);
//! Sets the material aMat defining this display attribute
//! for the interactive object.
//! Material aspect determines shading aspect, color and
//! transparency of visible entities.
Standard_EXPORT virtual void SetMaterial (const Graphic3d_MaterialAspect& aName);
//! Removes the setting for material.
Standard_EXPORT virtual void UnsetMaterial();
//! Attributes a setting aValue for transparency.
//! The transparency value should be between 0.0 and 1.0.
//! At 0.0 an object will be totally opaque, and at 1.0, fully transparent.
//! Warning At a value of 1.0, there may be nothing visible.
Standard_EXPORT virtual void SetTransparency (const Standard_Real aValue = 0.6);
//! Returns true if there is a transparency setting.
Standard_Boolean IsTransparent() const;
//! Returns the transparency setting.
//! This will be between 0.0 and 1.0.
//! At 0.0 an object will be totally opaque, and at 1.0, fully transparent.
Standard_EXPORT virtual Standard_Real Transparency() const;
//! Removes the transparency setting. The object is opaque by default.
Standard_EXPORT virtual void UnsetTransparency();
//! Clears settings provided by the drawing tool aDrawer.
Standard_EXPORT virtual void UnsetAttributes() Standard_OVERRIDE;
void State (const Standard_Integer theState);
Standard_Integer State() const;
//! Returns TRUE when this object has a presentation
//! in the current DisplayMode()
Standard_EXPORT Standard_Boolean HasPresentation() const;
//! Returns the current presentation of this object
//! according to the current DisplayMode()
Standard_EXPORT Handle(Prs3d_Presentation) Presentation() const;
//! Sets the graphic basic aspect to the current presentation.
//! When <globalChange> is TRUE , the full object presentation
//! is changed.
//! When <globalChange> is FALSE , only the current group
//! of the object presentation is changed.
Standard_EXPORT void SetAspect (const Handle(Prs3d_BasicAspect)& anAspect, const Standard_Boolean globalChange = Standard_True);
//! Sets up polygon offsets for this object.
//! It modifies all existing presentations of <anObj> (if any),
//! so it is reasonable to call this method after <anObj> has been displayed.
//! Otherwise, Compute() method should pass Graphic3d_AspectFillArea3d
//! aspect from <myDrawer> to Graphic3d_Group to make polygon offsets work.
//!
//! <aMode> parameter can contain various combinations of
//! Aspect_PolygonOffsetMode enumeration elements (Aspect_POM_None means
//! that polygon offsets are not changed).
//! If <aMode> is different from Aspect_POM_Off and Aspect_POM_None, then <aFactor> and <aUnits>
//! arguments are used by graphic renderer to calculate a depth offset value:
//!
//! offset = <aFactor> * m + <aUnits> * r, where
//! m - maximum depth slope for the polygon currently being displayed,
//! r - minimum window coordinates depth resolution (implementation-specific).
//!
//! Deafult settings for OCC 3D viewer: mode = Aspect_POM_Fill, factor = 1., units = 0.
//!
//! Negative offset values move polygons closer to the viewport,
//! while positive values shift polygons away.
//! Consult OpenGL reference for details (glPolygonOffset function description).
//!
//! NOTE: This method has a side effect - it creates own shading aspect
//! if not yet created, so it is better to set up object material,
//! color, etc. first.
Standard_EXPORT virtual void SetPolygonOffsets (const Standard_Integer aMode, const Standard_ShortReal aFactor = 1.0, const Standard_ShortReal aUnits = 0.0);
//! Returns Standard_True if <myDrawer> has non-null shading aspect
Standard_EXPORT virtual Standard_Boolean HasPolygonOffsets() const;
//! Retrieves current polygon offsets settings from <myDrawer>.
Standard_EXPORT virtual void PolygonOffsets (Standard_Integer& aMode, Standard_ShortReal& aFactor, Standard_ShortReal& aUnits) const;
//! Returns bounding box of object correspondingly to its current display mode.
Standard_EXPORT virtual void BoundingBox (Bnd_Box& theBndBox) Standard_OVERRIDE;
friend class AIS_InteractiveContext;
DEFINE_STANDARD_RTTI(AIS_InteractiveObject,SelectMgr_SelectableObject)
protected:
//! The TypeOfPresention3d means that the interactive object
//! may have a presentation dependant of the view of Display
Standard_EXPORT AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
Standard_Real myTransparency;
Quantity_Color myOwnColor;
Graphic3d_NameOfMaterial myOwnMaterial;
Standard_Integer myHilightMode;
Standard_Real myOwnWidth;
Standard_Boolean myInfiniteState;
Standard_Boolean hasOwnColor;
Standard_Boolean hasOwnMaterial;
Aspect_TypeOfFacingModel myCurrentFacingModel;
Standard_Boolean myRecomputeEveryPrs;
TColStd_ListOfInteger myToRecomputeModes;
private:
Standard_EXPORT virtual Standard_Boolean RecomputeEveryPrs() const;
Standard_EXPORT void MustRecomputePrs (const Standard_Integer aMode) const;
Standard_EXPORT const TColStd_ListOfInteger& ListOfRecomputeModes() const;
Standard_EXPORT void SetRecomputeOk();
AIS_PToContext myCTXPtr;
Handle(Standard_Transient) myOwner;
TColStd_ListOfTransient myUsers;
Standard_Integer mySelPriority;
Standard_Integer myDisplayMode;
Standard_Integer mySelectionMode;
Standard_Integer mystate;
};
#include <AIS_InteractiveObject.lxx>
#endif // _AIS_InteractiveObject_HeaderFile

View File

@ -0,0 +1,40 @@
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// 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 _AIS_KindOfDimension_HeaderFile
#define _AIS_KindOfDimension_HeaderFile
//! Declares the kinds of dimensions needed in the
//! display of Interactive Objects.
enum AIS_KindOfDimension
{
AIS_KOD_NONE,
AIS_KOD_LENGTH,
AIS_KOD_PLANEANGLE,
AIS_KOD_SOLIDANGLE,
AIS_KOD_AREA,
AIS_KOD_VOLUME,
AIS_KOD_MASS,
AIS_KOD_TIME,
AIS_KOD_RADIUS,
AIS_KOD_DIAMETER,
AIS_KOD_CHAMF2D,
AIS_KOD_CHAMF3D,
AIS_KOD_OFFSET,
AIS_KOD_ELLIPSERADIUS
};
#endif // _AIS_KindOfDimension_HeaderFile

View File

@ -0,0 +1,44 @@
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// 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 _AIS_KindOfInteractive_HeaderFile
#define _AIS_KindOfInteractive_HeaderFile
//! Declares the type of Interactive Object.
//! This is one of the following:
//! - the Datum
//! - the Object
//! - the Relation
//! - the Dimension
//! - the None type.
//! The Datum is the construction element. These include
//! points, lines, axes and planes. The object brings
//! together topological shapes. The Relation includes
//! dimensions and constraints. The Dimension includes
//! length, radius, diameter and angle dimensions.
//! When the object is of an unknown type, the None
//! type is declared.
enum AIS_KindOfInteractive
{
AIS_KOI_None,
AIS_KOI_Datum,
AIS_KOI_Shape,
AIS_KOI_Object,
AIS_KOI_Relation,
AIS_KOI_Dimension
};
#endif // _AIS_KindOfInteractive_HeaderFile

View File

@ -0,0 +1,33 @@
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// 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 _AIS_KindOfSurface_HeaderFile
#define _AIS_KindOfSurface_HeaderFile
enum AIS_KindOfSurface
{
AIS_KOS_Plane,
AIS_KOS_Cylinder,
AIS_KOS_Cone,
AIS_KOS_Sphere,
AIS_KOS_Torus,
AIS_KOS_Revolution,
AIS_KOS_Extrusion,
AIS_KOS_OtherSurface
};
#endif // _AIS_KindOfSurface_HeaderFile

View File

@ -0,0 +1,33 @@
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// 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 _AIS_KindOfUnit_HeaderFile
#define _AIS_KindOfUnit_HeaderFile
//! Declares the type of Interactive Object unit.
enum AIS_KindOfUnit
{
AIS_TOU_LENGTH,
AIS_TOU_SURFACE,
AIS_TOU_VOLUME,
AIS_TOU_PLANE_ANGLE,
AIS_TOU_SOLID_ANGLE,
AIS_TOU_MASS,
AIS_TOU_FORCE,
AIS_TOU_TIME
};
#endif // _AIS_KindOfUnit_HeaderFile

View File

@ -1,150 +0,0 @@
-- Created on: 1997-01-21
-- Created by: Prestataire Christiane ARMAND
-- 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 Line from AIS inherits InteractiveObject from AIS
---Purpose: Constructs line datums to be used in construction of
-- composite shapes.
uses
Line from Geom,
Point from Geom,
Presentation from Prs3d,
PresentationManager3d from PrsMgr,
NameOfColor from Quantity,
Color from Quantity,
Selection from SelectMgr,
Projector from Prs3d,
Transformation from Geom,
Line from AIS,
KindOfInteractive from AIS
is
Create(aLine : Line from Geom)
returns Line from AIS;
---Purpose: Initializes the line aLine.
Create(aStartPoint : Point from Geom;
aEndPoint : Point from Geom)
returns Line from AIS;
---Purpose: Initializes a starting point aStartPoint
-- and a finishing point aEndPoint for the line.
Compute(me : mutable;
aPresentationManager: PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard = 0)
is redefined static private;
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: Presentation from Prs3d)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined;
---Purpose: computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
-- Methods from SelectableObject
ComputeSelection(me : mutable;
aSelection : Selection from SelectMgr;
aMode : Integer from Standard)is private;
-- Methods from InteractiveObject
Signature(me) returns Integer from Standard is redefined;
---Purpose: Returns the signature 5.
---C++: inline
Type(me) returns KindOfInteractive from AIS is redefined;
---Purpose: Returns the type Datum.
---C++: inline
Line(me) returns any Line from Geom;
---C++: inline
---C++: return const &
---Purpose: Constructs an infinite line.
Points(me;PStart,PEnd: out Point from Geom);
---Purpose: Returns the starting point PStart and the end point
-- PEnd of the line set by SetPoints.
---C++: inline
SetLine(me:mutable;L : Line from Geom);
---C++: inline
---Purpose: instantiates an infinite line.
SetPoints(me:mutable;P1,P2:Point from Geom);
--- Purpose:
-- Sets the starting point P1 and ending point P2 of the
-- infinite line to create a finite line segment.
---C++: inline
SetColor(me :mutable; aColor : NameOfColor from Quantity)
is redefined static;
---Purpose: Provides a new color setting aColor for the line in the
-- drawing tool, or "Drawer".
SetColor(me :mutable; aColor : Color from Quantity)
is redefined static;
SetWidth(me:mutable; aValue:Real from Standard)
is redefined static;
---Purpose: Provides the new width setting aValue for the line in
-- the drawing tool, or "Drawer".
UnsetColor(me:mutable)
is redefined static;
---Purpose: Removes the color setting and returns the original color.
UnsetWidth(me:mutable)
is redefined static;
---Purpose: Removes the width setting and returns the original width.
ComputeInfiniteLine(me: mutable;
aPresentation : Presentation from Prs3d)
is private;
ComputeSegmentLine(me: mutable;
aPresentation : Presentation from Prs3d)
is private;
ComputeInfiniteLineSelection(me: mutable;
aSelection : Selection from SelectMgr)
is private;
ComputeSegmentLineSelection(me: mutable;
aSelection : Selection from SelectMgr)
is private;
fields
myComponent : Line from Geom;
myStartPoint : Point from Geom;
myEndPoint : Point from Geom;
myLineIsSegment : Boolean from Standard;
end Line;

View File

@ -14,24 +14,29 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_Line.ixx>
#include <AIS_GraphicTool.hxx>
#include <AIS_Line.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Prs3d_Drawer.hxx>
#include <Precision.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_Structure.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <StdPrs_Curve.hxx>
#include <Geom_Line.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GC_MakeSegment.hxx>
#include <Geom_Line.hxx>
#include <Geom_Point.hxx>
#include <Geom_Transformation.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_Structure.hxx>
#include <Precision.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <Quantity_Color.hxx>
#include <AIS_GraphicTool.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard_Type.hxx>
#include <StdPrs_Curve.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <UnitsAPI.hxx>
//==================================================================
@ -49,8 +54,6 @@ static void FindLimits(const Adaptor3d_Curve& aCurve,
Standard_Real Last = aCurve.LastParameter();
Standard_Boolean firstInf = Precision::IsNegativeInfinite(First);
Standard_Boolean lastInf = Precision::IsPositiveInfinite(Last);
if (firstInf || lastInf) {
Standard_Real delta = 1;
if (firstInf && lastInf) {
@ -82,7 +85,6 @@ static void FindLimits(const Adaptor3d_Curve& aCurve,
}
#endif
*/
//=======================================================================
//function : AIS_Line
//purpose :

145
src/AIS/AIS_Line.hxx Normal file
View File

@ -0,0 +1,145 @@
// Created on: 1997-01-21
// Created by: Prestataire Christiane ARMAND
// 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 _AIS_Line_HeaderFile
#define _AIS_Line_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Boolean.hxx>
#include <AIS_InteractiveObject.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
#include <AIS_KindOfInteractive.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Standard_Real.hxx>
class Geom_Line;
class Geom_Point;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class Quantity_Color;
class AIS_Line;
DEFINE_STANDARD_HANDLE(AIS_Line, AIS_InteractiveObject)
//! Constructs line datums to be used in construction of
//! composite shapes.
class AIS_Line : public AIS_InteractiveObject
{
public:
//! Initializes the line aLine.
Standard_EXPORT AIS_Line(const Handle(Geom_Line)& aLine);
//! Initializes a starting point aStartPoint
//! and a finishing point aEndPoint for the line.
Standard_EXPORT AIS_Line(const Handle(Geom_Point)& aStartPoint, const Handle(Geom_Point)& aEndPoint);
//! computes the presentation according to a point of view
//! given by <aProjector>.
//! To be Used when the associated degenerated Presentations
//! have been transformed by <aTrsf> which is not a Pure
//! Translation. The HLR Prs can't be deducted automatically
//! WARNING :<aTrsf> must be applied
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
//! Returns the signature 5.
virtual Standard_Integer Signature() const Standard_OVERRIDE;
//! Returns the type Datum.
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
//! Constructs an infinite line.
const Handle(Geom_Line)& Line() const;
//! Returns the starting point PStart and the end point
//! PEnd of the line set by SetPoints.
void Points (Handle(Geom_Point)& PStart, Handle(Geom_Point)& PEnd) const;
//! instantiates an infinite line.
void SetLine (const Handle(Geom_Line)& L);
//! Sets the starting point P1 and ending point P2 of the
//! infinite line to create a finite line segment.
void SetPoints (const Handle(Geom_Point)& P1, const Handle(Geom_Point)& P2);
//! Provides a new color setting aColor for the line in the
//! drawing tool, or "Drawer".
Standard_EXPORT void SetColor (const Quantity_NameOfColor aColor) Standard_OVERRIDE;
Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
//! Provides the new width setting aValue for the line in
//! the drawing tool, or "Drawer".
Standard_EXPORT void SetWidth (const Standard_Real aValue) Standard_OVERRIDE;
//! Removes the color setting and returns the original color.
Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
//! Removes the width setting and returns the original width.
Standard_EXPORT void UnsetWidth() Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_Line,AIS_InteractiveObject)
protected:
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode);
Standard_EXPORT void ComputeInfiniteLine (const Handle(Prs3d_Presentation)& aPresentation);
Standard_EXPORT void ComputeSegmentLine (const Handle(Prs3d_Presentation)& aPresentation);
Standard_EXPORT void ComputeInfiniteLineSelection (const Handle(SelectMgr_Selection)& aSelection);
Standard_EXPORT void ComputeSegmentLineSelection (const Handle(SelectMgr_Selection)& aSelection);
Handle(Geom_Line) myComponent;
Handle(Geom_Point) myStartPoint;
Handle(Geom_Point) myEndPoint;
Standard_Boolean myLineIsSegment;
};
#include <AIS_Line.lxx>
#endif // _AIS_Line_HeaderFile

View File

@ -1,601 +0,0 @@
-- Created on: 1996-09-04
-- Created by: Robert COUBLANC
-- 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.
-- Modified May 20th 98 :
-- Modification in Management of selected entities
-- Now we store the selected entity Owner in AIS_Selection.
-- (no more links with Session...)
-- Modifications in Management of hilight of detected entities
-- VTN 23/11/99 BUC60614 Avoid to crash because
-- myStdFilters array is too short.
class LocalContext from AIS inherits TShared from MMgt
---Purpose: Defines a specific context for selection.
-- It becomes possible to:
-- + Load InteractiveObjects with a mode to be
-- activated + associate InteractiveObjects with a
-- set of temporary selectable Objects.... + +
-- activate StandardMode of selection for Entities
-- inheriting BasicShape from AIS (Selection Of
-- vertices, edges, wires,faces... + Add Filters
-- acting on detected owners of sensitive primitives
--
--
-- - automatically highlight shapes and
-- InteractiveObjects (highlight of detected shape +
-- highlight of detected selectable...
--
uses
AsciiString from TCollection,
ListOfInteger from TColStd,
SequenceOfInteger from TColStd,
MapOfTransient from TColStd,
Array1OfPnt2d from TColgp,
NameOfColor from Quantity,
ShapeEnum from TopAbs,
Shape from TopoDS,
View from V3d,
PresentationManager3d from PrsMgr,
IndexedMapOfOwner from SelectMgr,
EntityOwner from SelectMgr,
OrFilter from SelectMgr,
Filter from SelectMgr,
SelectionManager from SelectMgr,
SelectableObject from SelectMgr ,
ListOfFilter from SelectMgr,
BRepOwner from StdSelect,
ViewerSelector3d from StdSelect,
SensitivityMode from StdSelect,
InteractiveContext from AIS,
ClearMode from AIS,
InteractiveObject from AIS,
Shape from AIS,
DataMapOfSelStat from AIS,
LocalStatus from AIS,
StatusOfPick from AIS,
StatusOfDetection from AIS,
SequenceOfInteractive from AIS
is
Create returns LocalContext from AIS;
Create (aCtx : InteractiveContext from AIS;
anIndex : Integer from Standard;
LoadDisplayed : Boolean from Standard=Standard_True;
AcceptStandardModes : Boolean from Standard=Standard_True;
AcceptErase : Boolean from Standard= Standard_False;
UseBothViewers : Boolean from Standard= Standard_False)
returns LocalContext from AIS;
---Purpose: Constructor By Default, the displayed objects are
-- automatically loaded.
AcceptErase(me:mutable;aStatus : Boolean from Standard);
---C++: inline
---Purpose: authorize or not others contexts to erase
-- temporary displayed objects here;
AcceptErase(me) returns Boolean from Standard;
---C++: inline
SetContext(me:mutable;aCtx:InteractiveContext from AIS);
SelectionName(me) returns AsciiString from TCollection;
---C++: inline
---C++: return const&
Terminate(me: mutable; updateviewer : Boolean from Standard = Standard_True);
Reactivate(me:mutable);
---Purpose: to be called when a upper local context was closed...
-- useful to put pack the right projector...
---Category: LOAD AND PREPARE
-- - INTERACTIVE OBJECTS...
-- - FILTERS
-- - STANDARD MODES OF ACTIVATION
Display(me : mutable;
anInteractive : InteractiveObject from AIS;
DisplayMode : Integer from Standard = 0;
AllowShapeDecomposition: Boolean from Standard = Standard_True;
ActivationMode : Integer from Standard = 0)
returns Boolean from Standard;
---Purpose: returns true if done...
Load(me : mutable;
anInteractive : InteractiveObject from AIS;
AllowShapeDecomposition: Boolean from Standard = Standard_True;
ActivationMode : Integer from Standard = 0)
returns Boolean from Standard;
---Purpose: loads <anInteractive> with nodisplay...
-- returns true if done
Erase(me: mutable;
anInteractive : InteractiveObject from AIS)
returns Boolean from Standard;
---Purpose: returns true if done...
Remove(me : mutable;
aSelectable : InteractiveObject from AIS)
returns Boolean from Standard;
ClearPrs (me : mutable;
anInteractive : InteractiveObject from AIS;
aMode : Integer from Standard)
returns Boolean from Standard;
SetShapeDecomposition(me : mutable;
aStoredObject : InteractiveObject from AIS;
aStatus : Boolean from Standard);
---Purpose: allows or forbids the shape decomposition into
-- Activated Standard Mode for <aStoredObject>
-- does nothing if the object doesn't inherits
-- BasicShape from AIS
Clear(me:mutable;atype: ClearMode from AIS = AIS_CM_All);
---Purpose: according to <atype> , clears the different parts of
-- the selector (filters, modeof activation, objects...)
ActivateMode (me : mutable;
aSelectable: InteractiveObject from AIS;
aMode : Integer from Standard );
---Purpose: optional : activation of a mode which is not 0 for a selectable...
DeactivateMode(me : mutable;
aSelectable: InteractiveObject from AIS;
aMode : Integer from Standard );
Deactivate(me : mutable;
aSelectable: InteractiveObject from AIS);
ActivateStandardMode(me:mutable;aType:ShapeEnum from TopAbs);
---Purpose: decomposition of shapes into <aType>
DeactivateStandardMode(me:mutable;aType:ShapeEnum from TopAbs);
StandardModes(me) returns ListOfInteger from TColStd;
---C++: return const &
---C++: inline
AddFilter(me:mutable;aFilter:Filter from SelectMgr);
RemoveFilter(me:mutable;aFilter: Filter from SelectMgr);
ListOfFilter(me) returns ListOfFilter from SelectMgr;
---C++: return const &
---C++: inline
Filter(me) returns any OrFilter from SelectMgr;
---C++: return const &
---C++: inline
SetAutomaticHilight(me:mutable ; aStatus:Boolean) ;
---Purpose: if <aStatus> = True , the shapes or subshapes detected
-- by the selector will be automatically hilighted in the
-- main viewer.
-- Else the user has to manage the detected shape outside the
-- Shape Selector....
---C++: inline
AutomaticHilight(me) returns Boolean;
---C++: inline
---Category: THE SELECTION PROCESS
MoveTo (me : mutable;
theXpix, theYpix : Integer from Standard;
theView : View from V3d;
theToRedrawImmediate : Boolean from Standard)
returns StatusOfDetection from AIS;
HasNextDetected(me) returns Boolean from Standard;
---C++: inline
---Purpose: returns True if more than one entity
-- was detected at the last Mouse position.
HilightNextDetected (me : mutable;
theView : View from V3d;
theToRedrawImmediate : Boolean from Standard)
returns Integer from Standard;
---Purpose: returns True if last detected. the next detected will
-- be first one (endless loop)
HilightPreviousDetected (me : mutable;
theView : View from V3d;
theToRedrawImmediate : Boolean from Standard)
returns Integer from Standard;
UnhilightLastDetected(me:mutable;aView:View from V3d) returns Boolean from Standard;
---Purpose: returns True if something was done...
Select(me: mutable;updateviewer : Boolean from Standard = Standard_True)
returns StatusOfPick from AIS;
---Purpose: returns the number of selected
ShiftSelect(me: mutable;updateviewer : Boolean from Standard = Standard_True)
returns StatusOfPick from AIS;
Select(me : mutable;
XPMin,YPMin,XPMax,YPMax : Integer from Standard;
aView : View from V3d;
updateviewer : Boolean from Standard = Standard_True)
returns StatusOfPick from AIS;
ShiftSelect(me : mutable;
XPMin,YPMin,XPMax,YPMax : Integer from Standard;
aView : View from V3d;
updateviewer : Boolean from Standard = Standard_True)
returns StatusOfPick from AIS;
Select(me : mutable;
Polyline : Array1OfPnt2d from TColgp;
aView : View from V3d;
updateviewer : Boolean from Standard = Standard_True)
returns StatusOfPick from AIS;
ShiftSelect(me : mutable;
Polyline : Array1OfPnt2d from TColgp;
aView : View from V3d;
updateviewer : Boolean from Standard = Standard_True)
returns StatusOfPick from AIS;
HilightPicked(me:mutable;updateviewer:Boolean from Standard =Standard_True) ;
UnhilightPicked(me:mutable;updateviewer:Boolean from Standard = Standard_True) ;
UpdateSelected (me : mutable;
updateviewer : Boolean from Standard = Standard_True);
UpdateSelected (me : mutable;
anobj : InteractiveObject from AIS;
updateviewer : Boolean from Standard = Standard_True);
---Purpose: Part of advanced selection highlighting mechanism.
-- If no owners belonging to anobj are selected, calls anobj->ClearSelected(),
-- otherwise calls anobj->HilightSelected(). This method can be used to avoid
-- redrawing the whole selection belonging to several Selectable Objects.
SetSelected(me : mutable;
anobj : InteractiveObject from AIS;
updateviewer : Boolean from Standard=Standard_True);
---Purpose: useful to update selection with objects coming from
-- Collector or stack
AddOrRemoveSelected(me : mutable;
anobj : InteractiveObject from AIS;
updateviewer : Boolean from Standard=Standard_True);
---Purpose: useful to update selection with objects coming from
-- Collector or stack
AddOrRemoveSelected(me : mutable;
aShape : Shape from TopoDS;
updateviewer : Boolean from Standard=Standard_True);
AddOrRemoveSelected(me : mutable;
theOwner : EntityOwner from SelectMgr;
toUpdateViewer : Boolean from Standard = Standard_True);
ClearSelected (me : mutable;
toUpdateViewer : Boolean from Standard = Standard_True);
---Purpose: Clears local context selection.
-- @param toUpdateViewer [in] if TRUE the viewer will be updated.
ClearOutdatedSelection (me : mutable;
theIO : InteractiveObject from AIS;
toClearDeactivated : Boolean from Standard);
---Purpose: Clears outdated selection and detection of owners for the
-- interactive object. Use this method if selection structures
-- of the interactive object have changed. The method unhilights
-- and removes outdated entity owners from lists of selected
-- and detected owners.
-- @param theIO [in] the interactive object.
-- @param toClearDeactivated [in] pass TRUE to treat deactivated
-- entity owners as 'outdated' when clearing the selection.
---Category: GET THE DETECTED
HasDetected (me) returns Boolean from Standard;
---C++: inline
InitDetected(me: mutable);
---Purpose:
-- Initialization for iteration through mouse-detected objects in local context.
MoreDetected(me) returns Boolean from Standard;
---Purpose:
-- @return true if there is more mouse-detected objects after the current one
-- during iteration through mouse-detected interactive objects.
NextDetected(me: mutable);
---Purpose:
-- Gets next current object during iteration through mouse-detected
-- interactive objects.
DetectedCurrentShape(me) returns Shape from TopoDS;
---C++: return const &
---Purpose:
-- @return current mouse-detected shape or empty (null) shape, if current interactive object
-- is not a shape (AIS_Shape) or there is no current mouse-detected interactive object at all.
DetectedCurrentObject(me) returns InteractiveObject from AIS;
---Purpose:
-- @return current mouse-detected interactive object or null object if there is no current detected.
HasDetectedShape(me) returns Boolean from Standard;
DetectedShape (me) returns Shape from TopoDS;
---C++: return const &
DetectedInteractive(me) returns InteractiveObject from AIS;
DetectedOwner (me) returns EntityOwner from SelectMgr;
---Category: GET THE SELECTED
InitSelected (me: mutable);
MoreSelected(me) returns Boolean from Standard;
NextSelected(me:mutable);
HasShape(me) returns Boolean from Standard;
---Purpose: returns TRUE if the detected entity is a shape
-- coming from a Decomposition of an element.
HasSelectedShape(me) returns Boolean from Standard;
---Purpose: returns true if current selection is not empty
-- and the owner of selected object contains a shape.
-- This method does not take into account decomposition
-- status of detected shape.
SelectedShape(me) returns Shape from TopoDS;
SelectedOwner(me) returns EntityOwner from SelectMgr;
IsSelected(me;aniobj: InteractiveObject from AIS) returns Boolean from Standard;
IsSelected(me;anOwner: EntityOwner from SelectMgr) returns Boolean from Standard;
SelectedInteractive(me) returns InteractiveObject from AIS;
HasApplicative (me) returns Boolean from Standard;
---Purpose: returns TRUE if an interactive element
-- was associated with the current picked entity.
SelectedApplicative(me) returns any Transient from Standard;
---C++: return const &
---Category: Management Of Temporary Attributes
SetDisplayPriority(me : mutable;
anObject: InteractiveObject from AIS;
Prior : Integer from Standard);
DisplayedObjects(me;theMapToFill : in out MapOfTransient from TColStd)
returns Integer from Standard;
IsIn(me;anObject : InteractiveObject from AIS)
returns Boolean from Standard;
IsDisplayed(me;anObject : InteractiveObject from AIS)
returns Boolean from Standard;
IsDisplayed(me;anObject : InteractiveObject from AIS;
aMode : Integer from Standard)
returns Boolean from Standard;
SelectionModes(me;anObject:InteractiveObject from AIS)
returns ListOfInteger from TColStd;
---C++: return const &
SubIntensityOn(me:mutable; anObject : InteractiveObject from AIS );
SubIntensityOff(me:mutable; anObject : InteractiveObject from AIS );
Hilight(me: mutable; anObject : InteractiveObject from AIS);
Hilight(me:mutable; anObject : InteractiveObject from AIS;aCol:NameOfColor from Quantity);
Unhilight(me:mutable; anObject : InteractiveObject from AIS);
IsHilighted(me;anObject : InteractiveObject from AIS)
returns Boolean from Standard;
IsHilighted(me;
anObject : InteractiveObject from AIS;
WithColor : out Boolean from Standard;
HiCol : out NameOfColor from Quantity)
returns Boolean from Standard;
SetPixelTolerance(me:mutable;
aPrecision: Real from Standard = 2);
---Level: Public
---Purpose: Define the current selection sensitivity for
-- this local context according to the view size.
PixelTolerance(me) returns Real from Standard;
---Level: Public
---Purpose: Returns the pixel tolerance.
---Category: IMMEDIATE MODE
BeginImmediateDraw (me : mutable)
returns Boolean from Standard;
---Purpose: Resets the transient list of presentations previously displayed in immediate mode
-- and begins accumulation of new list by following AddToImmediateList()/Color()/Highlight() calls.
ClearImmediateDraw (me : mutable) is virtual;
---Purpose: Resets the transient list of presentations previously displayed in immediate mode.
ImmediateAdd (me : mutable;
theObj : InteractiveObject from AIS;
theMode : Integer from Standard = 0)
returns Boolean from Standard;
---Purpose: Stores presentation theMode of object theObj in the transient list of presentations to be displayed in immediate mode.
-- Will be taken in account in EndImmediateDraw method.
EndImmediateDraw (me : mutable;
theView : View from V3d)
returns Boolean from Standard;
---Purpose: Allows rapid drawing of the view theView by avoiding an update of the whole background.
IsImmediateModeOn (me) returns Boolean from Standard;
---Purpose: Returns true if Presentation Manager is accumulating transient list of presentations to be displayed in immediate mode.
---Category: INTERNAL METHODS;
Status(me) returns AsciiString from TCollection;
Status(me;anObject : InteractiveObject from AIS)
returns any LocalStatus from AIS;
---C++: return const&
LoadContextObjects(me:mutable);
UnloadContextObjects(me:mutable);
Process(me : mutable;
anObject : SelectableObject from SelectMgr) is static private;
Process(me:mutable) is static private;
ActivateStandardModes(me:mutable;anObject: SelectableObject from SelectMgr) is static private;
manageDetected (me : mutable;
thePickOwner : EntityOwner from SelectMgr;
theView : View from V3d;
theToRedrawImmediate : Boolean from Standard) is static private;
DetectedIndex(me:mutable) returns Integer from Standard is static private;
---C++: inline
---Purpose: returns 0 if the detected entity was Not FilterOK...
Hilight(me:mutable;Own:EntityOwner from SelectMgr;aview: View from V3d) is static private;
Unhilight(me:mutable;Ownr:EntityOwner from SelectMgr;aview: View from V3d) is static private;
ClearObjects(me:mutable) is static private;
ClearDetected(me:mutable) is static private;
IsDecompositionOn(me) returns Boolean from Standard is static private;
IsShape(me;anIndex:Integer from Standard) returns Boolean from Standard is static private;
IsValidForSelection(me;anIObj:InteractiveObject from AIS) returns Boolean from Standard is static private;
IsValidIndex(me;anIndex:Integer from Standard)
returns Boolean from Standard is static private;
---C++: inline
ComesFromDecomposition(me; aPickedIndex : Integer from Standard)
returns Boolean from Standard is static private;
HasFilters(me;aType:ShapeEnum from TopAbs)
returns Boolean from Standard is private;
DisplaySensitive(me:mutable;aView : View from V3d) is static;
ClearSensitive(me:mutable;aView:View from V3d) is static;
MainSelector(me) returns ViewerSelector3d from StdSelect;
---C++: inline
---C++: return const&
FindSelectedOwnerFromIO(me;anIObj:InteractiveObject from AIS)
returns EntityOwner from SelectMgr;
FindSelectedOwnerFromShape(me;aShape : Shape from TopoDS)
returns EntityOwner from SelectMgr;
fields
myCTX : InteractiveContext from AIS;
myLoadDisplayed,myAcceptStdMode : Boolean from Standard;
myAcceptErase : Boolean from Standard;
mySM : SelectionManager from SelectMgr;
myMainVS : ViewerSelector3d from StdSelect;
myMainPM : PresentationManager3d from PrsMgr;
mySelName : AsciiString from TCollection;
myCollVS : ViewerSelector3d from StdSelect;
-- The Objects and their attributes...
myActiveObjects : DataMapOfSelStat from AIS;
-- The Filters...
myFilters : OrFilter from SelectMgr;
myListOfStandardMode : ListOfInteger from TColStd;
-- VTN myStdFilters : Filter from SelectMgr [7]; --internal mgt
myStdFilters : Filter from SelectMgr [9]; --internal mgt
-- Selection Process
myAutoHilight : Boolean from Standard;
myMapOfOwner : IndexedMapOfOwner from SelectMgr;
mylastindex : Integer from Standard;
mylastgood : Integer from Standard;
myCurrentOwner : Integer from Standard;
myDetectedSeq : SequenceOfInteger from TColStd;
myCurDetected : Integer from Standard;
-- The detected objects.
myAISDetectedSeq : SequenceOfInteractive from AIS;
-- the sequence of detected interative objects.
myAISCurDetected : Integer from Standard;
-- current detected interactive object.
-- This variable is used by following functions:
-- InitDetected(), MoreDetected(), NextDetected(), DetectedCurrentShape(), DetectedCurrentObject().
end LocalContext;

View File

@ -16,32 +16,40 @@
//Modified by ROB : Traque des UpdateConversion intempestifs.
#include <AIS_LocalContext.ixx>
#include <SelectMgr_OrFilter.hxx>
#include <SelectMgr_CompositionFilter.hxx>
#include <AIS_LocalStatus.hxx>
#include <AIS_Shape.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <AIS_DataMapIteratorOfDataMapOfSelStat.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_ListIteratorOfListOfInteractive.hxx>
#include <AIS_ListOfInteractive.hxx>
#include <AIS_DataMapIteratorOfDataMapOfSelStat.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <AIS_LocalContext.hxx>
#include <AIS_LocalStatus.hxx>
#include <AIS_Selection.hxx>
#include <AIS_Shape.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <Graphic3d_Structure.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_PlaneAspect.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <SelectMgr_CompositionFilter.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_OrFilter.hxx>
#include <SelectMgr_SelectableObject.hxx>
#include <SelectMgr_SelectionManager.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
#include <StdSelect_ShapeTypeFilter.hxx>
#include <StdSelect_ViewerSelector3d.hxx>
#include <AIS_Selection.hxx>
#include <V3d_Viewer.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS_Shape.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>
#include <Visual3d_View.hxx>
#include <AIS_InteractiveObject.hxx>
#include <stdio.h>
static TCollection_AsciiString AIS_Local_SelName(const Standard_Address address,
const Standard_Integer anIndex)
{

View File

@ -0,0 +1,432 @@
// Created on: 1996-09-04
// Created by: Robert COUBLANC
// 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 _AIS_LocalContext_HeaderFile
#define _AIS_LocalContext_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Boolean.hxx>
#include <StdSelect_ViewerSelector3d.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <TCollection_AsciiString.hxx>
#include <AIS_DataMapOfSelStat.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <SelectMgr_IndexedMapOfOwner.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <AIS_SequenceOfInteractive.hxx>
#include <MMgt_TShared.hxx>
#include <AIS_ClearMode.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <SelectMgr_ListOfFilter.hxx>
#include <AIS_StatusOfDetection.hxx>
#include <AIS_StatusOfPick.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_MapOfTransient.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Standard_Real.hxx>
class AIS_InteractiveContext;
class SelectMgr_SelectionManager;
class SelectMgr_OrFilter;
class SelectMgr_Filter;
class TCollection_AsciiString;
class AIS_InteractiveObject;
class V3d_View;
class TopoDS_Shape;
class SelectMgr_EntityOwner;
class Standard_Transient;
class AIS_LocalStatus;
class SelectMgr_SelectableObject;
class AIS_LocalContext;
DEFINE_STANDARD_HANDLE(AIS_LocalContext, MMgt_TShared)
//! Defines a specific context for selection.
//! It becomes possible to:
//! + Load InteractiveObjects with a mode to be
//! activated + associate InteractiveObjects with a
//! set of temporary selectable Objects.... + +
//! activate StandardMode of selection for Entities
//! inheriting BasicShape from AIS (Selection Of
//! vertices, edges, wires,faces... + Add Filters
//! acting on detected owners of sensitive primitives
//!
//! - automatically highlight shapes and
//! InteractiveObjects (highlight of detected shape +
//! highlight of detected selectable...
class AIS_LocalContext : public MMgt_TShared
{
public:
Standard_EXPORT AIS_LocalContext();
//! Constructor By Default, the displayed objects are
//! automatically loaded.
Standard_EXPORT AIS_LocalContext(const Handle(AIS_InteractiveContext)& aCtx, const Standard_Integer anIndex, const Standard_Boolean LoadDisplayed = Standard_True, const Standard_Boolean AcceptStandardModes = Standard_True, const Standard_Boolean AcceptErase = Standard_False, const Standard_Boolean UseBothViewers = Standard_False);
//! authorize or not others contexts to erase
//! temporary displayed objects here;
void AcceptErase (const Standard_Boolean aStatus);
Standard_Boolean AcceptErase() const;
Standard_EXPORT void SetContext (const Handle(AIS_InteractiveContext)& aCtx);
const TCollection_AsciiString& SelectionName() const;
Standard_EXPORT void Terminate (const Standard_Boolean updateviewer = Standard_True);
//! to be called when a upper local context was closed...
//! useful to put pack the right projector...
Standard_EXPORT void Reactivate();
//! returns true if done...
Standard_EXPORT Standard_Boolean Display (const Handle(AIS_InteractiveObject)& anInteractive, const Standard_Integer DisplayMode = 0, const Standard_Boolean AllowShapeDecomposition = Standard_True, const Standard_Integer ActivationMode = 0);
//! loads <anInteractive> with nodisplay...
//! returns true if done
Standard_EXPORT Standard_Boolean Load (const Handle(AIS_InteractiveObject)& anInteractive, const Standard_Boolean AllowShapeDecomposition = Standard_True, const Standard_Integer ActivationMode = 0);
//! returns true if done...
Standard_EXPORT Standard_Boolean Erase (const Handle(AIS_InteractiveObject)& anInteractive);
Standard_EXPORT Standard_Boolean Remove (const Handle(AIS_InteractiveObject)& aSelectable);
Standard_EXPORT Standard_Boolean ClearPrs (const Handle(AIS_InteractiveObject)& anInteractive, const Standard_Integer aMode);
//! allows or forbids the shape decomposition into
//! Activated Standard Mode for <aStoredObject>
//! does nothing if the object doesn't inherits
//! BasicShape from AIS
Standard_EXPORT void SetShapeDecomposition (const Handle(AIS_InteractiveObject)& aStoredObject, const Standard_Boolean aStatus);
//! according to <atype> , clears the different parts of
//! the selector (filters, modeof activation, objects...)
Standard_EXPORT void Clear (const AIS_ClearMode atype = AIS_CM_All);
//! optional : activation of a mode which is not 0 for a selectable...
Standard_EXPORT void ActivateMode (const Handle(AIS_InteractiveObject)& aSelectable, const Standard_Integer aMode);
Standard_EXPORT void DeactivateMode (const Handle(AIS_InteractiveObject)& aSelectable, const Standard_Integer aMode);
Standard_EXPORT void Deactivate (const Handle(AIS_InteractiveObject)& aSelectable);
//! decomposition of shapes into <aType>
Standard_EXPORT void ActivateStandardMode (const TopAbs_ShapeEnum aType);
Standard_EXPORT void DeactivateStandardMode (const TopAbs_ShapeEnum aType);
const TColStd_ListOfInteger& StandardModes() const;
Standard_EXPORT void AddFilter (const Handle(SelectMgr_Filter)& aFilter);
Standard_EXPORT void RemoveFilter (const Handle(SelectMgr_Filter)& aFilter);
const SelectMgr_ListOfFilter& ListOfFilter() const;
const Handle(SelectMgr_OrFilter)& Filter() const;
//! if <aStatus> = True , the shapes or subshapes detected
//! by the selector will be automatically hilighted in the
//! main viewer.
//! Else the user has to manage the detected shape outside the
//! Shape Selector....
void SetAutomaticHilight (const Standard_Boolean aStatus);
Standard_Boolean AutomaticHilight() const;
Standard_EXPORT AIS_StatusOfDetection MoveTo (const Standard_Integer theXpix, const Standard_Integer theYpix, const Handle(V3d_View)& theView, const Standard_Boolean theToRedrawImmediate);
//! returns True if more than one entity
//! was detected at the last Mouse position.
Standard_Boolean HasNextDetected() const;
//! returns True if last detected. the next detected will
//! be first one (endless loop)
Standard_EXPORT Standard_Integer HilightNextDetected (const Handle(V3d_View)& theView, const Standard_Boolean theToRedrawImmediate);
Standard_EXPORT Standard_Integer HilightPreviousDetected (const Handle(V3d_View)& theView, const Standard_Boolean theToRedrawImmediate);
//! returns True if something was done...
Standard_EXPORT Standard_Boolean UnhilightLastDetected (const Handle(V3d_View)& aView);
//! returns the number of selected
Standard_EXPORT AIS_StatusOfPick Select (const Standard_Boolean updateviewer = Standard_True);
Standard_EXPORT AIS_StatusOfPick ShiftSelect (const Standard_Boolean updateviewer = Standard_True);
Standard_EXPORT AIS_StatusOfPick Select (const Standard_Integer XPMin, const Standard_Integer YPMin, const Standard_Integer XPMax, const Standard_Integer YPMax, const Handle(V3d_View)& aView, const Standard_Boolean updateviewer = Standard_True);
Standard_EXPORT AIS_StatusOfPick ShiftSelect (const Standard_Integer XPMin, const Standard_Integer YPMin, const Standard_Integer XPMax, const Standard_Integer YPMax, const Handle(V3d_View)& aView, const Standard_Boolean updateviewer = Standard_True);
Standard_EXPORT AIS_StatusOfPick Select (const TColgp_Array1OfPnt2d& Polyline, const Handle(V3d_View)& aView, const Standard_Boolean updateviewer = Standard_True);
Standard_EXPORT AIS_StatusOfPick ShiftSelect (const TColgp_Array1OfPnt2d& Polyline, const Handle(V3d_View)& aView, const Standard_Boolean updateviewer = Standard_True);
Standard_EXPORT void HilightPicked (const Standard_Boolean updateviewer = Standard_True);
Standard_EXPORT void UnhilightPicked (const Standard_Boolean updateviewer = Standard_True);
Standard_EXPORT void UpdateSelected (const Standard_Boolean updateviewer = Standard_True);
//! Part of advanced selection highlighting mechanism.
//! If no owners belonging to anobj are selected, calls anobj->ClearSelected(),
//! otherwise calls anobj->HilightSelected(). This method can be used to avoid
//! redrawing the whole selection belonging to several Selectable Objects.
Standard_EXPORT void UpdateSelected (const Handle(AIS_InteractiveObject)& anobj, const Standard_Boolean updateviewer = Standard_True);
//! useful to update selection with objects coming from
//! Collector or stack
Standard_EXPORT void SetSelected (const Handle(AIS_InteractiveObject)& anobj, const Standard_Boolean updateviewer = Standard_True);
//! useful to update selection with objects coming from
//! Collector or stack
Standard_EXPORT void AddOrRemoveSelected (const Handle(AIS_InteractiveObject)& anobj, const Standard_Boolean updateviewer = Standard_True);
Standard_EXPORT void AddOrRemoveSelected (const TopoDS_Shape& aShape, const Standard_Boolean updateviewer = Standard_True);
Standard_EXPORT void AddOrRemoveSelected (const Handle(SelectMgr_EntityOwner)& theOwner, const Standard_Boolean toUpdateViewer = Standard_True);
//! Clears local context selection.
//! @param toUpdateViewer [in] if TRUE the viewer will be updated.
Standard_EXPORT void ClearSelected (const Standard_Boolean toUpdateViewer = Standard_True);
//! Clears outdated selection and detection of owners for the
//! interactive object. Use this method if selection structures
//! of the interactive object have changed. The method unhilights
//! and removes outdated entity owners from lists of selected
//! and detected owners.
//! @param theIO [in] the interactive object.
//! @param toClearDeactivated [in] pass TRUE to treat deactivated
//! entity owners as 'outdated' when clearing the selection.
Standard_EXPORT void ClearOutdatedSelection (const Handle(AIS_InteractiveObject)& theIO, const Standard_Boolean toClearDeactivated);
Standard_Boolean HasDetected() const;
//! Initialization for iteration through mouse-detected objects in local context.
Standard_EXPORT void InitDetected();
//! @return true if there is more mouse-detected objects after the current one
//! during iteration through mouse-detected interactive objects.
Standard_EXPORT Standard_Boolean MoreDetected() const;
//! Gets next current object during iteration through mouse-detected
//! interactive objects.
Standard_EXPORT void NextDetected();
//! @return current mouse-detected shape or empty (null) shape, if current interactive object
//! is not a shape (AIS_Shape) or there is no current mouse-detected interactive object at all.
Standard_EXPORT const TopoDS_Shape& DetectedCurrentShape() const;
//! @return current mouse-detected interactive object or null object if there is no current detected.
Standard_EXPORT Handle(AIS_InteractiveObject) DetectedCurrentObject() const;
Standard_EXPORT Standard_Boolean HasDetectedShape() const;
Standard_EXPORT const TopoDS_Shape& DetectedShape() const;
Standard_EXPORT Handle(AIS_InteractiveObject) DetectedInteractive() const;
Standard_EXPORT Handle(SelectMgr_EntityOwner) DetectedOwner() const;
Standard_EXPORT void InitSelected();
Standard_EXPORT Standard_Boolean MoreSelected() const;
Standard_EXPORT void NextSelected();
//! returns TRUE if the detected entity is a shape
//! coming from a Decomposition of an element.
Standard_EXPORT Standard_Boolean HasShape() const;
//! returns true if current selection is not empty
//! and the owner of selected object contains a shape.
//! This method does not take into account decomposition
//! status of detected shape.
Standard_EXPORT Standard_Boolean HasSelectedShape() const;
Standard_EXPORT TopoDS_Shape SelectedShape() const;
Standard_EXPORT Handle(SelectMgr_EntityOwner) SelectedOwner() const;
Standard_EXPORT Standard_Boolean IsSelected (const Handle(AIS_InteractiveObject)& aniobj) const;
Standard_EXPORT Standard_Boolean IsSelected (const Handle(SelectMgr_EntityOwner)& anOwner) const;
Standard_EXPORT Handle(AIS_InteractiveObject) SelectedInteractive() const;
//! returns TRUE if an interactive element
//! was associated with the current picked entity.
Standard_EXPORT Standard_Boolean HasApplicative() const;
Standard_EXPORT const Handle(Standard_Transient)& SelectedApplicative() const;
Standard_EXPORT void SetDisplayPriority (const Handle(AIS_InteractiveObject)& anObject, const Standard_Integer Prior);
Standard_EXPORT Standard_Integer DisplayedObjects (TColStd_MapOfTransient& theMapToFill) const;
Standard_EXPORT Standard_Boolean IsIn (const Handle(AIS_InteractiveObject)& anObject) const;
Standard_EXPORT Standard_Boolean IsDisplayed (const Handle(AIS_InteractiveObject)& anObject) const;
Standard_EXPORT Standard_Boolean IsDisplayed (const Handle(AIS_InteractiveObject)& anObject, const Standard_Integer aMode) const;
Standard_EXPORT const TColStd_ListOfInteger& SelectionModes (const Handle(AIS_InteractiveObject)& anObject) const;
Standard_EXPORT void SubIntensityOn (const Handle(AIS_InteractiveObject)& anObject);
Standard_EXPORT void SubIntensityOff (const Handle(AIS_InteractiveObject)& anObject);
Standard_EXPORT void Hilight (const Handle(AIS_InteractiveObject)& anObject);
Standard_EXPORT void Hilight (const Handle(AIS_InteractiveObject)& anObject, const Quantity_NameOfColor aCol);
Standard_EXPORT void Unhilight (const Handle(AIS_InteractiveObject)& anObject);
Standard_EXPORT Standard_Boolean IsHilighted (const Handle(AIS_InteractiveObject)& anObject) const;
Standard_EXPORT Standard_Boolean IsHilighted (const Handle(AIS_InteractiveObject)& anObject, Standard_Boolean& WithColor, Quantity_NameOfColor& HiCol) const;
//! Define the current selection sensitivity for
//! this local context according to the view size.
Standard_EXPORT void SetPixelTolerance (const Standard_Real aPrecision = 2);
//! Returns the pixel tolerance.
Standard_EXPORT Standard_Real PixelTolerance() const;
//! Resets the transient list of presentations previously displayed in immediate mode
//! and begins accumulation of new list by following AddToImmediateList()/Color()/Highlight() calls.
Standard_EXPORT Standard_Boolean BeginImmediateDraw();
//! Resets the transient list of presentations previously displayed in immediate mode.
Standard_EXPORT virtual void ClearImmediateDraw();
//! Stores presentation theMode of object theObj in the transient list of presentations to be displayed in immediate mode.
//! Will be taken in account in EndImmediateDraw method.
Standard_EXPORT Standard_Boolean ImmediateAdd (const Handle(AIS_InteractiveObject)& theObj, const Standard_Integer theMode = 0);
//! Allows rapid drawing of the view theView by avoiding an update of the whole background.
Standard_EXPORT Standard_Boolean EndImmediateDraw (const Handle(V3d_View)& theView);
//! Returns true if Presentation Manager is accumulating transient list of presentations to be displayed in immediate mode.
Standard_EXPORT Standard_Boolean IsImmediateModeOn() const;
Standard_EXPORT TCollection_AsciiString Status() const;
Standard_EXPORT const Handle(AIS_LocalStatus)& Status (const Handle(AIS_InteractiveObject)& anObject) const;
Standard_EXPORT void LoadContextObjects();
Standard_EXPORT void UnloadContextObjects();
Standard_EXPORT void DisplaySensitive (const Handle(V3d_View)& aView);
Standard_EXPORT void ClearSensitive (const Handle(V3d_View)& aView);
const Handle(StdSelect_ViewerSelector3d)& MainSelector() const;
Standard_EXPORT Handle(SelectMgr_EntityOwner) FindSelectedOwnerFromIO (const Handle(AIS_InteractiveObject)& anIObj) const;
Standard_EXPORT Handle(SelectMgr_EntityOwner) FindSelectedOwnerFromShape (const TopoDS_Shape& aShape) const;
DEFINE_STANDARD_RTTI(AIS_LocalContext,MMgt_TShared)
protected:
private:
Standard_EXPORT void Process (const Handle(SelectMgr_SelectableObject)& anObject);
Standard_EXPORT void Process();
Standard_EXPORT void ActivateStandardModes (const Handle(SelectMgr_SelectableObject)& anObject);
Standard_EXPORT void manageDetected (const Handle(SelectMgr_EntityOwner)& thePickOwner, const Handle(V3d_View)& theView, const Standard_Boolean theToRedrawImmediate);
//! returns 0 if the detected entity was Not FilterOK...
Standard_Integer DetectedIndex();
Standard_EXPORT void Hilight (const Handle(SelectMgr_EntityOwner)& Own, const Handle(V3d_View)& aview);
Standard_EXPORT void Unhilight (const Handle(SelectMgr_EntityOwner)& Ownr, const Handle(V3d_View)& aview);
Standard_EXPORT void ClearObjects();
Standard_EXPORT void ClearDetected();
Standard_EXPORT Standard_Boolean IsDecompositionOn() const;
Standard_EXPORT Standard_Boolean IsShape (const Standard_Integer anIndex) const;
Standard_EXPORT Standard_Boolean IsValidForSelection (const Handle(AIS_InteractiveObject)& anIObj) const;
Standard_Boolean IsValidIndex (const Standard_Integer anIndex) const;
Standard_EXPORT Standard_Boolean ComesFromDecomposition (const Standard_Integer aPickedIndex) const;
Standard_EXPORT Standard_Boolean HasFilters (const TopAbs_ShapeEnum aType) const;
Handle(AIS_InteractiveContext) myCTX;
Standard_Boolean myLoadDisplayed;
Standard_Boolean myAcceptStdMode;
Standard_Boolean myAcceptErase;
Handle(SelectMgr_SelectionManager) mySM;
Handle(StdSelect_ViewerSelector3d) myMainVS;
Handle(PrsMgr_PresentationManager3d) myMainPM;
TCollection_AsciiString mySelName;
Handle(StdSelect_ViewerSelector3d) myCollVS;
AIS_DataMapOfSelStat myActiveObjects;
Handle(SelectMgr_OrFilter) myFilters;
TColStd_ListOfInteger myListOfStandardMode;
Handle(SelectMgr_Filter) myStdFilters[9];
Standard_Boolean myAutoHilight;
Handle(SelectMgr_IndexedMapOfOwner) myMapOfOwner;
Standard_Integer mylastindex;
Standard_Integer mylastgood;
Standard_Integer myCurrentOwner;
TColStd_SequenceOfInteger myDetectedSeq;
Standard_Integer myCurDetected;
AIS_SequenceOfInteractive myAISDetectedSeq;
Standard_Integer myAISCurDetected;
};
#include <AIS_LocalContext.lxx>
#endif // _AIS_LocalContext_HeaderFile

View File

@ -18,35 +18,41 @@
// - use of optimisation in SelectMgr_ViewerSelector
// -> Best management in detected entities...
#include <AIS_LocalContext.jxx>
#include <StdSelect_BRepOwner.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_MapOfTransient.hxx>
#include <TColStd_MapIteratorOfMapOfTransient.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_LocalContext.hxx>
#include <AIS_LocalStatus.hxx>
#include <AIS_Selection.hxx>
#include <AIS_Shape.hxx>
#include <Aspect_Grid.hxx>
#include <Geom_Transformation.hxx>
#include <Graphic3d_ArrayOfTriangles.hxx>
#include <Graphic3d_Group.hxx>
#include <Select3D_SensitiveTriangulation.hxx>
#include <StdSelect_ViewerSelector3d.hxx>
#include <SelectBasics_SensitiveEntity.hxx>
#include <TCollection_AsciiString.hxx>
#include <NCollection_Map.hxx>
#include <Visual3d_View.hxx>
#include <SelectMgr_Selection.hxx>
#include <SelectMgr_SequenceOfOwner.hxx>
#include <OSD_Environment.hxx>
#include <Geom_Transformation.hxx>
#include <AIS_Selection.hxx>
#include <Aspect_Grid.hxx>
#include <AIS_Shape.hxx>
#include <AIS_InteractiveObject.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Select3D_SensitiveTriangulation.hxx>
#include <SelectBasics_SensitiveEntity.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Filter.hxx>
#include <SelectMgr_OrFilter.hxx>
#include <SelectMgr_SelectableObject.hxx>
#include <SelectMgr_Selection.hxx>
#include <SelectMgr_SelectionManager.hxx>
#include <SelectMgr_SequenceOfOwner.hxx>
#include <Standard_Transient.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <StdSelect_ViewerSelector3d.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfTransient.hxx>
#include <TColStd_MapOfTransient.hxx>
#include <TopoDS_Shape.hxx>
#include <V3d_View.hxx>
#include <Visual3d_View.hxx>
static Standard_Integer GetHiMod(const Handle(AIS_InteractiveObject)& IO)
{

View File

@ -1,105 +0,0 @@
-- Created on: 1997-01-20
-- Created by: Robert COUBLANC
-- 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 LocalStatus from AIS inherits TShared from MMgt
---Purpose: Stored Info about temporary objects.
uses
ListOfInteger from TColStd,
NameOfColor from Quantity
is
Create(IsTemporary : Boolean from Standard = Standard_True;
Decompose : Boolean from Standard = Standard_False;
DisplayMode : Integer from Standard = -1;
SelectionMode : Integer from Standard = -1;
HilightMode : Integer from Standard = 0;
SubIntensity : Boolean from Standard = 0;
TheHiCol : NameOfColor from Quantity = Quantity_NOC_WHITE)
returns LocalStatus from AIS;
---Category: Read
Decomposed(me) returns Boolean from Standard;
---C++: inline
IsTemporary(me) returns Boolean from Standard;
---C++: inline
DisplayMode(me) returns Integer from Standard;
---C++: inline
SelectionModes(me) returns ListOfInteger from TColStd;
---C++: return const&
---C++: inline
IsActivated(me; aSelMode :Integer from Standard)
returns Boolean from Standard;
HilightMode(me) returns Integer from Standard;
---C++: inline
IsSubIntensityOn(me) returns Boolean from Standard;
---C++: inline
HilightColor(me) returns NameOfColor from Quantity;
---C++: inline
SetDecomposition (me:mutable; astatus : Boolean from Standard);
---C++: inline
SetTemporary (me:mutable; astatus : Boolean from Standard);
---C++: inline
SetDisplayMode (me:mutable; aMode : Integer from Standard);
---C++: inline
SetFirstDisplay (me:mutable; aStatus : Boolean from Standard) ;
---C++: inline
IsFirstDisplay(me) returns Boolean from Standard;
---C++: inline
AddSelectionMode (me:mutable; aMode : Integer from Standard);
RemoveSelectionMode(me:mutable; aMode : Integer from Standard);
ClearSelectionModes(me:mutable);
IsSelModeIn(me;aMode:Integer from Standard)
returns Boolean from Standard;
SetHilightMode (me:mutable; aMode : Integer from Standard);
---C++: inline
SetHilightColor (me:mutable;aHiCol:NameOfColor from Quantity);
---C++: inline
SubIntensityOn (me:mutable);
---C++: inline
SubIntensityOff (me:mutable);
---C++: inline
SetPreviousState(me:mutable;aStatus : Transient from Standard);
---C++: inline
PreviousState(me) returns any Transient from Standard;
---C++: inline
---C++: return const &
fields
myDecomposition : Boolean from Standard;
myIsTemporary : Boolean from Standard;
myDMode : Integer from Standard;
myFirstDisplay : Boolean from Standard;
myHMode : Integer from Standard;
mySModes : ListOfInteger from TColStd;
mySubIntensity : Boolean from Standard;
myHiCol : NameOfColor from Quantity;
myPreviousState : Transient from Standard;
end LocalStatus;

View File

@ -12,9 +12,11 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_LocalStatus.ixx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <AIS_LocalStatus.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
AIS_LocalStatus::AIS_LocalStatus(const Standard_Boolean IsTemp,
const Standard_Boolean Decomp,

122
src/AIS/AIS_LocalStatus.hxx Normal file
View File

@ -0,0 +1,122 @@
// Created on: 1997-01-20
// Created by: Robert COUBLANC
// 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 _AIS_LocalStatus_HeaderFile
#define _AIS_LocalStatus_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <Quantity_NameOfColor.hxx>
#include <MMgt_TShared.hxx>
class Standard_Transient;
class AIS_LocalStatus;
DEFINE_STANDARD_HANDLE(AIS_LocalStatus, MMgt_TShared)
//! Stored Info about temporary objects.
class AIS_LocalStatus : public MMgt_TShared
{
public:
Standard_EXPORT AIS_LocalStatus(const Standard_Boolean IsTemporary = Standard_True, const Standard_Boolean Decompose = Standard_False, const Standard_Integer DisplayMode = -1, const Standard_Integer SelectionMode = -1, const Standard_Integer HilightMode = 0, const Standard_Boolean SubIntensity = 0, const Quantity_NameOfColor TheHiCol = Quantity_NOC_WHITE);
Standard_Boolean Decomposed() const;
Standard_Boolean IsTemporary() const;
Standard_Integer DisplayMode() const;
const TColStd_ListOfInteger& SelectionModes() const;
Standard_EXPORT Standard_Boolean IsActivated (const Standard_Integer aSelMode) const;
Standard_Integer HilightMode() const;
Standard_Boolean IsSubIntensityOn() const;
Quantity_NameOfColor HilightColor() const;
void SetDecomposition (const Standard_Boolean astatus);
void SetTemporary (const Standard_Boolean astatus);
void SetDisplayMode (const Standard_Integer aMode);
void SetFirstDisplay (const Standard_Boolean aStatus);
Standard_Boolean IsFirstDisplay() const;
Standard_EXPORT void AddSelectionMode (const Standard_Integer aMode);
Standard_EXPORT void RemoveSelectionMode (const Standard_Integer aMode);
Standard_EXPORT void ClearSelectionModes();
Standard_EXPORT Standard_Boolean IsSelModeIn (const Standard_Integer aMode) const;
void SetHilightMode (const Standard_Integer aMode);
void SetHilightColor (const Quantity_NameOfColor aHiCol);
void SubIntensityOn();
void SubIntensityOff();
void SetPreviousState (const Handle(Standard_Transient)& aStatus);
const Handle(Standard_Transient)& PreviousState() const;
DEFINE_STANDARD_RTTI(AIS_LocalStatus,MMgt_TShared)
protected:
private:
Standard_Boolean myDecomposition;
Standard_Boolean myIsTemporary;
Standard_Integer myDMode;
Standard_Boolean myFirstDisplay;
Standard_Integer myHMode;
TColStd_ListOfInteger mySModes;
Standard_Boolean mySubIntensity;
Quantity_NameOfColor myHiCol;
Handle(Standard_Transient) myPreviousState;
};
#include <AIS_LocalStatus.lxx>
#endif // _AIS_LocalStatus_HeaderFile

View File

@ -1,120 +0,0 @@
-- Created on: 1998-01-22
-- Created by: Sergey ZARITCHNY
-- Copyright (c) 1998-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 MaxRadiusDimension from AIS inherits EllipseRadiusDimension from AIS
---Purpose:
-- Ellipse Max radius dimension of a Shape which can be Edge
-- or Face (planar or cylindrical(surface of extrusion or
-- surface of offset))
uses
Shape from TopoDS,
Elips from gp,
Pnt from gp,
Pln from gp,
Ellipse from Geom,
OffsetCurve from Geom,
Plane from Geom,
Surface from Geom,
Presentation from Prs3d,
PresentationManager3d from PrsMgr,
Selection from SelectMgr,
Projector from Prs3d,
Transformation from Geom,
ExtendedString from TCollection,
ArrowSide from DsgPrs,
KindOfSurface from AIS,
KindOfDimension from AIS
raises ConstructionError from Standard
is
Create (aShape : Shape from TopoDS;
aVal : Real from Standard;
aText : ExtendedString from TCollection)
---Purpose: Max Ellipse radius dimension
-- Shape can be edge , planar face or cylindrical face
--
returns MaxRadiusDimension from AIS;
Create (aShape : Shape from TopoDS;
aVal : Real from Standard;
aText : ExtendedString from TCollection;
aPosition : Pnt from gp;
aSymbolPrs : ArrowSide from DsgPrs;
anArrowSize : Real from Standard = 0.0)
---Purpose: Max Ellipse radius dimension with position
-- Shape can be edge , planar face or cylindrical face
--
returns MaxRadiusDimension from AIS;
-- Methods from PresentableObject
Compute(me : mutable;
aPresentationManager: PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard= 0)
is redefined private;
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: Presentation from Prs3d)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined;
---Purpose: computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
-- Methods from SelectableObject
ComputeSelection(me : mutable;
aSelection : Selection from SelectMgr;
aMode : Integer from Standard)
is redefined private;
--
-- Computation private methods
--
ComputeEllipse(me: mutable;
aPresentation : Presentation from Prs3d)
is private;
ComputeArcOfEllipse(me: mutable;
aPresentation : Presentation from Prs3d )
is private;
fields
myApexP : Pnt from gp;
myApexN : Pnt from gp;
myEndOfArrow : Pnt from gp;
end MaxRadiusDimension;

View File

@ -14,59 +14,54 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_NotImplemented.hxx>
#include <AIS_MaxRadiusDimension.ixx>
#include <AIS_EllipseRadiusDimension.hxx>
#include <TCollection_ExtendedString.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_TextAspect.hxx>
#include <Prs3d_Text.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <Select3D_SensitiveCurve.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <ElCLib.hxx>
#include <ElSLib.hxx>
#include <TopoDS.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_OffsetCurve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Lin.hxx>
#include <gp_Ax1.hxx>
#include <gp_Dir.hxx>
#include <gp_Vec.hxx>
#include <AIS.hxx>
#include <Precision.hxx>
#include <AIS_EllipseRadiusDimension.hxx>
#include <AIS_MaxRadiusDimension.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <DsgPrs_EllipseRadiusPresentation.hxx>
#include <ElCLib.hxx>
#include <ElSLib.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_OffsetCurve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_Transformation.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <gp_Ax1.hxx>
#include <gp_Dir.hxx>
#include <gp_Lin.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <Precision.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <Prs3d_Text.hxx>
#include <Prs3d_TextAspect.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveCurve.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : AIS_MaxRadiusDimension
//purpose :
//=======================================================================
AIS_MaxRadiusDimension::AIS_MaxRadiusDimension(const TopoDS_Shape& aShape,
const Standard_Real aVal,
const TCollection_ExtendedString& aText)

View File

@ -0,0 +1,105 @@
// Created on: 1998-01-22
// Created by: Sergey ZARITCHNY
// Copyright (c) 1998-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 _AIS_MaxRadiusDimension_HeaderFile
#define _AIS_MaxRadiusDimension_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <gp_Pnt.hxx>
#include <AIS_EllipseRadiusDimension.hxx>
#include <Standard_Real.hxx>
#include <DsgPrs_ArrowSide.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
class Standard_ConstructionError;
class TopoDS_Shape;
class TCollection_ExtendedString;
class gp_Pnt;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class AIS_MaxRadiusDimension;
DEFINE_STANDARD_HANDLE(AIS_MaxRadiusDimension, AIS_EllipseRadiusDimension)
//! Ellipse Max radius dimension of a Shape which can be Edge
//! or Face (planar or cylindrical(surface of extrusion or
//! surface of offset))
class AIS_MaxRadiusDimension : public AIS_EllipseRadiusDimension
{
public:
//! Max Ellipse radius dimension
//! Shape can be edge , planar face or cylindrical face
Standard_EXPORT AIS_MaxRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText);
//! Max Ellipse radius dimension with position
//! Shape can be edge , planar face or cylindrical face
Standard_EXPORT AIS_MaxRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText, const gp_Pnt& aPosition, const DsgPrs_ArrowSide aSymbolPrs, const Standard_Real anArrowSize = 0.0);
//! computes the presentation according to a point of view
//! given by <aProjector>.
//! To be Used when the associated degenerated Presentations
//! have been transformed by <aTrsf> which is not a Pure
//! Translation. The HLR Prs can't be deducted automatically
//! WARNING :<aTrsf> must be applied
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_MaxRadiusDimension,AIS_EllipseRadiusDimension)
protected:
private:
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeEllipse (const Handle(Prs3d_Presentation)& aPresentation);
Standard_EXPORT void ComputeArcOfEllipse (const Handle(Prs3d_Presentation)& aPresentation);
gp_Pnt myApexP;
gp_Pnt myApexN;
gp_Pnt myEndOfArrow;
};
#endif // _AIS_MaxRadiusDimension_HeaderFile

View File

@ -1,134 +0,0 @@
-- Created on: 2000-10-20
-- Created by: Julia DOROVSKIKH
-- 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 MidPointRelation from AIS inherits Relation from AIS
---Purpose: presentation of equal distance to point myMidPoint
uses
ExtendedString from TCollection,
Projector from Prs3d,
Presentation from Prs3d,
PresentationManager3d from PrsMgr,
Selection from SelectMgr,
Dir from gp,
Pnt from gp,
Lin from gp,
Circ from gp,
Elips from gp,
Plane from Geom,
Transformation from Geom,
Shape from TopoDS
is
Create(aSymmTool : Shape from TopoDS;
FirstShape : Shape from TopoDS;
SecondShape : Shape from TopoDS;
aPlane : Plane from Geom)
returns MidPointRelation from AIS;
IsMovable(me) returns Boolean from Standard
---C++: inline
is redefined;
SetTool(me: mutable; aMidPointTool : Shape from TopoDS);
---C++: inline
GetTool(me)
---C++: inline
---C++: return const &
returns Shape from TopoDS;
-- Methods from PresentableObject
Compute(me: mutable;
aPresentationManager: PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard= 0)
is redefined static private;
Compute(me: mutable;
aProjector : Projector from Prs3d;
aPresentation: Presentation from Prs3d)
is redefined static private;
Compute(me: mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined;
---Purpose: Computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
-- Methods from SelectableObject
ComputeSelection(me : mutable;
aSelection : Selection from SelectMgr;
aMode : Integer from Standard)is private;
-- Computation private methods
ComputeFaceFromPnt(me: mutable; aprs : Presentation from Prs3d; first : Boolean from Standard)
is private;
ComputeEdgeFromPnt(me: mutable; aprs : Presentation from Prs3d; first : Boolean from Standard)
is private;
ComputeVertexFromPnt(me: mutable; aprs : Presentation from Prs3d; first : Boolean from Standard)
is private;
ComputePointsOnLine(me: mutable; aLin : Lin from gp;
first : Boolean from Standard)
is private;
ComputePointsOnLine(me: mutable; pnt1,pnt2 : Pnt from gp;
first : Boolean from Standard)
is private;
ComputePointsOnCirc(me: mutable; aCirc : Circ from gp; pnt1,pnt2 : Pnt from gp;
first : Boolean from Standard)
is private;
ComputePointsOnElips(me: mutable; anEll : Elips from gp; pnt1,pnt2 : Pnt from gp;
first : Boolean from Standard)
is private;
---Purpose: ComputePointsOn... methods set myFAttach, myFirstPnt and myLastPnt
-- from the following initial data: curve, end points, myMidPoint.
-- End points (pnt1 & pnt2) and curve define the trimmed curve.
-- If end points are equal, curve is not trimmed (line - special case).
--
-- .------. pnt2
-- / \
-- . circle . myLastPnt
-- | |
-- . pnt1 . myFAttach
-- \ arc / . myMidPoint
-- .______. myFirstPnt
fields
myTool : Shape from TopoDS;
myMidPoint : Pnt from gp; -- point of symmetry
myFAttach : Pnt from gp; -- position on myFShape to be connected with myMidPoint by segment
myFirstPnt1 : Pnt from gp; -- points on myFShape,
myFirstPnt2 : Pnt from gp; -- defining a segment of it to be drawn
mySAttach : Pnt from gp; -- position on mySShape to be connected with myMidPoint by segment
mySecondPnt1 : Pnt from gp; -- points on mySShape,
mySecondPnt2 : Pnt from gp; -- defining a segment of it to be drawn
end MidPointRelation;

View File

@ -13,46 +13,44 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <AIS_MidPointRelation.ixx>
#include <Standard_NotImplemented.hxx>
#include <Precision.hxx>
#include <AIS.hxx>
#include <gce_MakeLin.hxx>
#include <AIS_MidPointRelation.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <DsgPrs_MidPointPresentation.hxx>
#include <ElCLib.hxx>
#include <gp_Lin.hxx>
#include <gp_Circ.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pln.hxx>
#include <gp_Dir.hxx>
#include <gp_Ax1.hxx>
#include <gp_Ax2.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Line.hxx>
#include <gce_MakeLin.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_Line.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <Select3D_SensitiveCurve.hxx>
#include <TopoDS.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <Prs3d_Drawer.hxx>
#include <gp_Ax1.hxx>
#include <gp_Ax2.hxx>
#include <gp_Circ.hxx>
#include <gp_Dir.hxx>
#include <gp_Elips.hxx>
#include <gp_Lin.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <Precision.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <DsgPrs_MidPointPresentation.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveCurve.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
//=======================================================================

View File

@ -0,0 +1,131 @@
// Created on: 2000-10-20
// Created by: Julia DOROVSKIKH
// 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 _AIS_MidPointRelation_HeaderFile
#define _AIS_MidPointRelation_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TopoDS_Shape.hxx>
#include <gp_Pnt.hxx>
#include <AIS_Relation.hxx>
#include <Standard_Boolean.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
class TopoDS_Shape;
class Geom_Plane;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class gp_Lin;
class gp_Pnt;
class gp_Circ;
class gp_Elips;
class AIS_MidPointRelation;
DEFINE_STANDARD_HANDLE(AIS_MidPointRelation, AIS_Relation)
//! presentation of equal distance to point myMidPoint
class AIS_MidPointRelation : public AIS_Relation
{
public:
Standard_EXPORT AIS_MidPointRelation(const TopoDS_Shape& aSymmTool, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane);
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE;
void SetTool (const TopoDS_Shape& aMidPointTool);
const TopoDS_Shape& GetTool() const;
//! Computes the presentation according to a point of view
//! given by <aProjector>.
//! To be Used when the associated degenerated Presentations
//! have been transformed by <aTrsf> which is not a Pure
//! Translation. The HLR Prs can't be deducted automatically
//! WARNING :<aTrsf> must be applied
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_MidPointRelation,AIS_Relation)
protected:
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode);
Standard_EXPORT void ComputeFaceFromPnt (const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first);
Standard_EXPORT void ComputeEdgeFromPnt (const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first);
Standard_EXPORT void ComputeVertexFromPnt (const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first);
Standard_EXPORT void ComputePointsOnLine (const gp_Lin& aLin, const Standard_Boolean first);
Standard_EXPORT void ComputePointsOnLine (const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Boolean first);
Standard_EXPORT void ComputePointsOnCirc (const gp_Circ& aCirc, const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Boolean first);
//! ComputePointsOn... methods set myFAttach, myFirstPnt and myLastPnt
//! from the following initial data: curve, end points, myMidPoint.
//! End points (pnt1 & pnt2) and curve define the trimmed curve.
//! If end points are equal, curve is not trimmed (line - special case).
//!
//! .------. pnt2
//! /
//! . circle . myLastPnt
//! | |
//! . pnt1 . myFAttach
//! \ arc / . myMidPoint
//! .______. myFirstPnt
Standard_EXPORT void ComputePointsOnElips (const gp_Elips& anEll, const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Boolean first);
TopoDS_Shape myTool;
gp_Pnt myMidPoint;
gp_Pnt myFAttach;
gp_Pnt myFirstPnt1;
gp_Pnt myFirstPnt2;
gp_Pnt mySAttach;
gp_Pnt mySecondPnt1;
gp_Pnt mySecondPnt2;
};
#include <AIS_MidPointRelation.lxx>
#endif // _AIS_MidPointRelation_HeaderFile

View File

@ -1,121 +0,0 @@
-- Created on: 1998-01-22
-- Created by: Sergey ZARITCHNY
-- Copyright (c) 1998-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 MinRadiusDimension from AIS inherits EllipseRadiusDimension from AIS
---Purpose:-- Ellipse Min radius dimension of a Shape which
-- can be Edge or Face (planar or cylindrical(surface of
-- extrusion or surface of offset))
uses
Shape from TopoDS,
Elips from gp,
Pnt from gp,
Pln from gp,
Ellipse from Geom,
Plane from Geom,
Surface from Geom,
Presentation from Prs3d,
PresentationManager3d from PrsMgr,
Selection from SelectMgr,
Projector from Prs3d,
Transformation from Geom,
ExtendedString from TCollection,
ArrowSide from DsgPrs,
KindOfSurface from AIS,
KindOfDimension from AIS
raises ConstructionError from Standard
is
Create (aShape : Shape from TopoDS;
aVal : Real from Standard;
aText : ExtendedString from TCollection)
---Purpose: Max Ellipse radius dimension
-- Shape can be edge , planar face or cylindrical face
--
returns MinRadiusDimension from AIS;
Create (aShape : Shape from TopoDS;
aVal : Real from Standard;
aText : ExtendedString from TCollection;
aPosition : Pnt from gp;
aSymbolPrs : ArrowSide from DsgPrs;
anArrowSize : Real from Standard = 0.0)
---Purpose: Max Ellipse radius dimension with position
-- Shape can be edge , planar face or cylindrical face
--
returns MinRadiusDimension from AIS;
-- Methods from PresentableObject
Compute(me : mutable;
aPresentationManager: PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard= 0)
is redefined private;
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: Presentation from Prs3d)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined;
---Purpose: computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
-- Methods from SelectableObject
ComputeSelection(me : mutable;
aSelection : Selection from SelectMgr;
aMode : Integer from Standard)
is redefined private;
--
-- Computation private methods
--
ComputeEllipse(me: mutable;
aPresentation : Presentation from Prs3d)
is private;
ComputeArcOfEllipse(me: mutable;
aPresentation : Presentation from Prs3d )
is private;
fields
myApexP : Pnt from gp;
myApexN : Pnt from gp;
myEndOfArrow : Pnt from gp;
end MinRadiusDimension;

View File

@ -14,61 +14,54 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_NotImplemented.hxx>
#include <AIS_MinRadiusDimension.ixx>
#include <AIS_EllipseRadiusDimension.hxx>
#include <TCollection_ExtendedString.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_TextAspect.hxx>
#include <Prs3d_Text.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <Select3D_SensitiveCurve.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <ElCLib.hxx>
#include <ElSLib.hxx>
#include <TopoDS.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_OffsetCurve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Lin.hxx>
#include <gp_Ax1.hxx>
#include <gp_Dir.hxx>
#include <gp_Vec.hxx>
#include <AIS.hxx>
#include <Precision.hxx>
#include <AIS_EllipseRadiusDimension.hxx>
#include <AIS_MinRadiusDimension.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <DsgPrs_EllipseRadiusPresentation.hxx>
#include <ElCLib.hxx>
#include <ElSLib.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_OffsetCurve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_Transformation.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <gp_Ax1.hxx>
#include <gp_Dir.hxx>
#include <gp_Lin.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <Precision.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <Prs3d_Text.hxx>
#include <Prs3d_TextAspect.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveCurve.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : AIS_MinRadiusDimension
//purpose :
//=======================================================================
AIS_MinRadiusDimension::AIS_MinRadiusDimension(const TopoDS_Shape& aShape,
const Standard_Real aVal,
const TCollection_ExtendedString& aText)

View File

@ -0,0 +1,104 @@
// Created on: 1998-01-22
// Created by: Sergey ZARITCHNY
// Copyright (c) 1998-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 _AIS_MinRadiusDimension_HeaderFile
#define _AIS_MinRadiusDimension_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <gp_Pnt.hxx>
#include <AIS_EllipseRadiusDimension.hxx>
#include <Standard_Real.hxx>
#include <DsgPrs_ArrowSide.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <SelectMgr_Selection.hxx>
class Standard_ConstructionError;
class TopoDS_Shape;
class TCollection_ExtendedString;
class gp_Pnt;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class AIS_MinRadiusDimension;
DEFINE_STANDARD_HANDLE(AIS_MinRadiusDimension, AIS_EllipseRadiusDimension)
//! -- Ellipse Min radius dimension of a Shape which
//! can be Edge or Face (planar or cylindrical(surface of
//! extrusion or surface of offset))
class AIS_MinRadiusDimension : public AIS_EllipseRadiusDimension
{
public:
//! Max Ellipse radius dimension
//! Shape can be edge , planar face or cylindrical face
Standard_EXPORT AIS_MinRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText);
//! Max Ellipse radius dimension with position
//! Shape can be edge , planar face or cylindrical face
Standard_EXPORT AIS_MinRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText, const gp_Pnt& aPosition, const DsgPrs_ArrowSide aSymbolPrs, const Standard_Real anArrowSize = 0.0);
//! computes the presentation according to a point of view
//! given by <aProjector>.
//! To be Used when the associated degenerated Presentations
//! have been transformed by <aTrsf> which is not a Pure
//! Translation. The HLR Prs can't be deducted automatically
//! WARNING :<aTrsf> must be applied
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_MinRadiusDimension,AIS_EllipseRadiusDimension)
protected:
private:
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeEllipse (const Handle(Prs3d_Presentation)& aPresentation);
Standard_EXPORT void ComputeArcOfEllipse (const Handle(Prs3d_Presentation)& aPresentation);
gp_Pnt myApexP;
gp_Pnt myApexN;
gp_Pnt myEndOfArrow;
};
#endif // _AIS_MinRadiusDimension_HeaderFile

View File

@ -1,138 +0,0 @@
-- Created on: 1997-04-22
-- Created by: Guest Design
-- 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 MultipleConnectedInteractive from AIS inherits InteractiveObject from AIS
---Purpose: Defines an Interactive Object by gathering together
-- several object presentations. This is done through a
-- list of interactive objects. These can also be
-- Connected objects. That way memory-costly
-- calculations of presentation are avoided.
uses
TypeOfPresentation3d from PrsMgr,
InteractiveObject from AIS,
Boolean from Standard,
SequenceOfInteractive from AIS,
KindOfInteractive from AIS,
PresentationManager3d from PrsMgr,
Presentation from Prs3d,
Projector from Prs3d,
Transformation from Geom,
Integer from Standard,
Selection from SelectMgr,
Trsf from gp,
Pnt from gp,
TransModeFlags from Graphic3d
is
Create
returns MultipleConnectedInteractive from AIS;
---Purpose: Initializes the Interactive Object with multiple
-- connections to AIS_Interactive objects.
Connect (me : mutable;
theInteractive : InteractiveObject from AIS)
returns InteractiveObject from AIS;
---Purpose: Establishes the connection between the Connected Interactive Object, theInteractive, and its reference.
-- Copies local transformation and transformation persistence mode from theInteractive.
-- @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive)
Connect (me : mutable;
theInteractive : InteractiveObject from AIS;
theLocation : Trsf from gp)
returns InteractiveObject from AIS;
---Purpose: Establishes the connection between the Connected Interactive Object, theInteractive, and its reference.
-- Locates instance in theLocation and copies transformation persistence mode from theInteractive.
-- @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive)
Connect (me : mutable;
theInteractive : InteractiveObject from AIS;
theLocation : Trsf from gp;
theTrsfPersFlag : TransModeFlags from Graphic3d;
theTrsfPersPoint : Pnt from gp )
returns InteractiveObject from AIS
is virtual;
---Purpose: Establishes the connection between the Connected Interactive Object, theInteractive, and its reference.
-- Locates instance in theLocation and applies specified transformation persistence mode.
-- @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive)
Type(me) returns KindOfInteractive from AIS
is redefined virtual;
Signature(me) returns Integer from Standard
is redefined virtual;
HasConnection(me) returns Boolean from Standard;
---Purpose: Returns true if the object is connected to others.
Disconnect(me : mutable;
theInteractive : InteractiveObject from AIS);
---Purpose: Removes the connection with theInteractive.
DisconnectAll(me:mutable);
---Purpose: Clears all the connections to objects.
Compute(me:mutable;
aPresentationManager : PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard = 0)
---Level: Internal
---Purpose: this method is redefined virtual;
-- when the instance is connected to another
-- InteractiveObject,this method doesn't
-- compute anything, but just uses the
-- presentation of this last object, with
-- a transformation if there's one stored.
is redefined virtual protected;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined;
---Purpose: computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: Presentation from Prs3d)
is redefined ;
AcceptShapeDecomposition(me) returns Boolean from Standard is redefined virtual;
---Purpose: Informs the graphic context that the interactive Object
-- may be decomposed into sub-shapes for dynamic selection.
ComputeSelection(me:mutable; aSelection : Selection from SelectMgr;
aMode : Integer from Standard)
is redefined virtual private;
---Purpose: Computes the selection for whole subtree in scene hierarchy.
end MultipleConnectedInteractive;

View File

@ -14,19 +14,24 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_NotImplemented.hxx>
#include <AIS_MultipleConnectedInteractive.ixx>
#include <AIS_ConnectedInteractive.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <AIS_MultipleConnectedInteractive.hxx>
#include <Geom_Transformation.hxx>
#include <gp_Pnt.hxx>
#include <gp_Trsf.hxx>
#include <NCollection_DataMap.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <PrsMgr_ModedPresentation.hxx>
#include <PrsMgr_Presentation.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Select3D_SensitiveEntity.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TopLoc_Location.hxx>
#include <NCollection_DataMap.hxx>
#include <AIS_InteractiveObject.hxx>
namespace
{

View File

@ -0,0 +1,133 @@
// Created on: 1997-04-22
// Created by: Guest Design
// 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 _AIS_MultipleConnectedInteractive_HeaderFile
#define _AIS_MultipleConnectedInteractive_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <AIS_InteractiveObject.hxx>
#include <Graphic3d_TransModeFlags.hxx>
#include <AIS_KindOfInteractive.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <SelectMgr_Selection.hxx>
class AIS_InteractiveObject;
class gp_Trsf;
class gp_Pnt;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class AIS_MultipleConnectedInteractive;
DEFINE_STANDARD_HANDLE(AIS_MultipleConnectedInteractive, AIS_InteractiveObject)
//! Defines an Interactive Object by gathering together
//! several object presentations. This is done through a
//! list of interactive objects. These can also be
//! Connected objects. That way memory-costly
//! calculations of presentation are avoided.
class AIS_MultipleConnectedInteractive : public AIS_InteractiveObject
{
public:
//! Initializes the Interactive Object with multiple
//! connections to AIS_Interactive objects.
Standard_EXPORT AIS_MultipleConnectedInteractive();
//! Establishes the connection between the Connected Interactive Object, theInteractive, and its reference.
//! Copies local transformation and transformation persistence mode from theInteractive.
//! @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive)
Standard_EXPORT Handle(AIS_InteractiveObject) Connect (const Handle(AIS_InteractiveObject)& theInteractive);
//! Establishes the connection between the Connected Interactive Object, theInteractive, and its reference.
//! Locates instance in theLocation and copies transformation persistence mode from theInteractive.
//! @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive)
Standard_EXPORT Handle(AIS_InteractiveObject) Connect (const Handle(AIS_InteractiveObject)& theInteractive, const gp_Trsf& theLocation);
//! Establishes the connection between the Connected Interactive Object, theInteractive, and its reference.
//! Locates instance in theLocation and applies specified transformation persistence mode.
//! @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive)
Standard_EXPORT virtual Handle(AIS_InteractiveObject) Connect (const Handle(AIS_InteractiveObject)& theInteractive, const gp_Trsf& theLocation, const Graphic3d_TransModeFlags& theTrsfPersFlag, const gp_Pnt& theTrsfPersPoint);
Standard_EXPORT virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Integer Signature() const Standard_OVERRIDE;
//! Returns true if the object is connected to others.
Standard_EXPORT Standard_Boolean HasConnection() const;
//! Removes the connection with theInteractive.
Standard_EXPORT void Disconnect (const Handle(AIS_InteractiveObject)& theInteractive);
//! Clears all the connections to objects.
Standard_EXPORT void DisconnectAll();
//! computes the presentation according to a point of view
//! given by <aProjector>.
//! To be Used when the associated degenerated Presentations
//! have been transformed by <aTrsf> which is not a Pure
//! Translation. The HLR Prs can't be deducted automatically
//! WARNING :<aTrsf> must be applied
//! to the object to display before computation !!!
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
//! Informs the graphic context that the interactive Object
//! may be decomposed into sub-shapes for dynamic selection.
Standard_EXPORT virtual Standard_Boolean AcceptShapeDecomposition() const Standard_OVERRIDE;
DEFINE_STANDARD_RTTI(AIS_MultipleConnectedInteractive,AIS_InteractiveObject)
protected:
//! this method is redefined virtual;
//! when the instance is connected to another
//! InteractiveObject,this method doesn't
//! compute anything, but just uses the
//! presentation of this last object, with
//! a transformation if there's one stored.
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
private:
//! Computes the selection for whole subtree in scene hierarchy.
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
};
#endif // _AIS_MultipleConnectedInteractive_HeaderFile

View File

@ -1,119 +0,0 @@
-- Created on: 1997-03-04
-- Created by: Jean-Pierre COMBE
-- 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 OffsetDimension from AIS inherits Relation from AIS
---Purpose: A framework to display dimensions of offsets.
-- The relation between the offset and the basis shape
-- is indicated. This relation is displayed with arrows and
-- text. The text gives the dsitance between the offset
-- and the basis shape.
uses
Shape from TopoDS,
Presentation from Prs3d,
Projector from Prs3d,
Transformation from Geom,
PresentationManager3d from PrsMgr,
Selection from SelectMgr,
Dir from gp,
Pnt from gp,
Trsf from gp,
KindOfDimension from AIS,
ExtendedString from TCollection
is
Create (FistShape, SecondShape : Shape from TopoDS;
aVal : Real from Standard;
aText : ExtendedString from TCollection)
returns OffsetDimension from AIS;
---Purpose: Constructs the offset display object defined by the
-- first shape aFShape, the second shape aSShape, the
-- dimension aVal, and the text aText.
Compute(me : mutable;
aPresentationManager: PresentationManager3d from PrsMgr;
aPresentation : Presentation from Prs3d;
aMode : Integer from Standard= 0)
is redefined private;
Compute(me:mutable;
aProjector: Projector from Prs3d;
aPresentation: Presentation from Prs3d)
is redefined static private;
Compute(me : mutable;
aProjector : Projector from Prs3d;
aTrsf : Transformation from Geom;
aPresentation : Presentation from Prs3d)
is redefined;
---Purpose: computes the presentation according to a point of view
-- given by <aProjector>.
-- To be Used when the associated degenerated Presentations
-- have been transformed by <aTrsf> which is not a Pure
-- Translation. The HLR Prs can't be deducted automatically
-- WARNING :<aTrsf> must be applied
-- to the object to display before computation !!!
-- Methods from SelectableObject
ComputeSelection(me : mutable;
aSelection : Selection from SelectMgr;
aMode : Integer from Standard)
is redefined private;
KindOfDimension(me)
---Purpose:
-- Indicates that the dimension we are concerned with is an offset.
---C++: inline
returns KindOfDimension from AIS
is redefined;
IsMovable(me)
---C++: inline
---Purpose: Returns true if the offset datum is movable.
returns Boolean from Standard
is redefined;
SetRelativePos (me:mutable; aTrsf: Trsf from gp);
---C++: inline
---Purpose: Sets a transformation aTrsf for presentation and
-- selection to a relative position.
ComputeTwoFacesOffset(me: mutable;
aPresentation : Presentation from Prs3d;
aTrsf : Trsf from gp)
is private;
ComputeTwoAxesOffset(me: mutable;
aPresentation : Presentation from Prs3d;
aTrsf : Trsf from gp)
is private;
ComputeAxeFaceOffset(me: mutable;
aPresentation : Presentation from Prs3d;
aTrsf : Trsf from gp)
is private;
fields
myFAttach : Pnt from gp;
mySAttach : Pnt from gp;
myDirAttach : Dir from gp;
myDirAttach2 : Dir from gp;
myRelativePos : Trsf from gp;
end OffsetDimension;

Some files were not shown because too many files have changed in this diff Show More