0031456: Visualization - move out Dimensions and Relations from package AIS to PrsDims
[occt.git] / src / PrsDim / PrsDim_OffsetDimension.hxx
CommitLineData
42cf5bc1 1// Created on: 1997-03-04
2// Created by: Jean-Pierre COMBE
3// Copyright (c) 1997-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
787ff240 17#ifndef _PrsDim_OffsetDimension_HeaderFile
18#define _PrsDim_OffsetDimension_HeaderFile
42cf5bc1 19
787ff240 20#include <PrsDim_Relation.hxx>
21#include <PrsDim_KindOfDimension.hxx>
42cf5bc1 22
787ff240 23DEFINE_STANDARD_HANDLE(PrsDim_OffsetDimension, PrsDim_Relation)
42cf5bc1 24
25//! A framework to display dimensions of offsets.
26//! The relation between the offset and the basis shape
27//! is indicated. This relation is displayed with arrows and
28//! text. The text gives the dsitance between the offset
29//! and the basis shape.
787ff240 30class PrsDim_OffsetDimension : public PrsDim_Relation
42cf5bc1 31{
787ff240 32 DEFINE_STANDARD_RTTIEXT(PrsDim_OffsetDimension, PrsDim_Relation)
42cf5bc1 33public:
34
42cf5bc1 35 //! Constructs the offset display object defined by the
36 //! first shape aFShape, the second shape aSShape, the
37 //! dimension aVal, and the text aText.
787ff240 38 Standard_EXPORT PrsDim_OffsetDimension(const TopoDS_Shape& FistShape, const TopoDS_Shape& SecondShape, const Standard_Real aVal, const TCollection_ExtendedString& aText);
42cf5bc1 39
40 //! Indicates that the dimension we are concerned with is an offset.
787ff240 41 virtual PrsDim_KindOfDimension KindOfDimension() const Standard_OVERRIDE { return PrsDim_KOD_OFFSET; }
42
42cf5bc1 43 //! Returns true if the offset datum is movable.
787ff240 44 virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
45
42cf5bc1 46 //! Sets a transformation aTrsf for presentation and
47 //! selection to a relative position.
787ff240 48 void SetRelativePos (const gp_Trsf& aTrsf) { myRelativePos = aTrsf; }
42cf5bc1 49
42cf5bc1 50private:
51
42cf5bc1 52 Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
53
42cf5bc1 54 Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
55
56 Standard_EXPORT void ComputeTwoFacesOffset (const Handle(Prs3d_Presentation)& aPresentation, const gp_Trsf& aTrsf);
57
58 Standard_EXPORT void ComputeTwoAxesOffset (const Handle(Prs3d_Presentation)& aPresentation, const gp_Trsf& aTrsf);
59
60 Standard_EXPORT void ComputeAxeFaceOffset (const Handle(Prs3d_Presentation)& aPresentation, const gp_Trsf& aTrsf);
61
787ff240 62private:
63
42cf5bc1 64 gp_Pnt myFAttach;
65 gp_Pnt mySAttach;
66 gp_Dir myDirAttach;
67 gp_Dir myDirAttach2;
68 gp_Trsf myRelativePos;
69
42cf5bc1 70};
71
787ff240 72#endif // _PrsDim_OffsetDimension_HeaderFile