/usr/include/oce/AIS_LengthDimension.hxx is in liboce-visualization-dev 0.18.2-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | // Copyright (c) 1999-2013 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_LengthDimension_HeaderFile
#define _AIS_LengthDimension_HeaderFile
#include <AIS.hxx>
#include <AIS_Dimension.hxx>
#include <AIS_KindOfDimension.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <gp_Pnt.hxx>
#include <gp_Dir.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <SelectMgr_Selection.hxx>
#include <Standard.hxx>
#include <Standard_Macro.hxx>
#include <Standard_DefineHandle.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
#include <TCollection_ExtendedString.hxx>
class TopoDS_Face;
class TCollection_ExtendedString;
class gp_Pnt;
class TopoDS_Edge;
class TopoDS_Shape;
class Geom_Plane;
class Prs3d_Presentation;
class Prs3d_Projector;
class Geom_Transformation;
class SelectMgr_Selection;
class Bnd_Box;
class gp_Dir;
class TopoDS_Vertex;
class Standard_Transient;
class Handle(Standard_Type);
class Handle(AIS_Relation);
class AIS_LengthDimension;
DEFINE_STANDARD_HANDLE (AIS_LengthDimension, AIS_Dimension)
//! Length dimension. Can be constructued:
//! - Between two generic points.
//! - Between two vertices.
//! - Between two faces.
//! - Between two parallel edges.
//! - Between face and edge.
//!
//! In case of two points (vertices) or one linear edge the user-defined plane
//! that includes this geometry is necessary to be set.
//!
//! In case of face-edge, edge-vertex or face-face lengthes the automatic plane
//! computing is allowed. For this plane the third point is found on the
//! edge or on the face.
//!
//! Please note that if the inappropriate geometry is defined
//! or the distance between measured points is less than
//! Precision::Confusion(), the dimension is invalid and its
//! presentation can not be computed.
class AIS_LengthDimension : public AIS_Dimension
{
public:
//! Construct length dimension between face and edge.
//! Here dimension can be built without user-defined plane.
//! @param theFace [in] the face (first shape).
//! @param theEdge [in] the edge (second shape).
Standard_EXPORT AIS_LengthDimension (const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge);
public:
//! Construct length dimension between two faces.
//! @param theFirstFace [in] the first face (first shape).
//! @param theSecondFace [in] the second face (second shape).
Standard_EXPORT AIS_LengthDimension (const TopoDS_Face& theFirstFace,
const TopoDS_Face& theSecondFace);
//! Construct length dimension between two points in
//! the specified plane.
//! @param theFirstPoint [in] the first point.
//! @param theSecondPoint [in] the second point.
//! @param thePlane [in] the plane to orient dimension.
Standard_EXPORT AIS_LengthDimension (const gp_Pnt& theFirstPoint,
const gp_Pnt& theSecondPoint,
const gp_Pln& thePlane);
//! Construct length dimension between two arbitrary shapes in
//! the specified plane.
//! @param theFirstShape [in] the first shape.
//! @param theSecondShape [in] the second shape.
//! @param thePlane [in] the plane to orient dimension.
Standard_EXPORT AIS_LengthDimension (const TopoDS_Shape& theFirstShape,
const TopoDS_Shape& theSecondShape,
const gp_Pln& thePlane);
//! Construct length dimension of linear edge.
//! @param theEdge [in] the edge to measure.
//! @param thePlane [in] the plane to orient dimension.
Standard_EXPORT AIS_LengthDimension (const TopoDS_Edge& theEdge,
const gp_Pln& thePlane);
public:
//! @return first attachement point.
const gp_Pnt& FirstPoint() const
{
return myFirstPoint;
}
//! @return second attachement point.
const gp_Pnt& SecondPoint() const
{
return mySecondPoint;
}
//! @return first attachement shape.
const TopoDS_Shape& FirstShape() const
{
return myFirstShape;
}
//! @return second attachement shape.
const TopoDS_Shape& SecondShape() const
{
return mySecondShape;
}
public:
//! Measure distance between two points.
//! The dimension will become invalid if the new distance between
//! attachement points is less than Precision::Confusion().
//! @param theFirstPoint [in] the first point.
//! @param theSecondPoint [in] the second point.
//! @param thePlane [in] the user-defined plane
Standard_EXPORT void SetMeasuredGeometry (const gp_Pnt& theFirstPoint,
const gp_Pnt& theSecondPoint,
const gp_Pln& thePlane);
//! Measure length of edge.
//! The dimension will become invalid if the new length of edge
//! is less than Precision::Confusion().
//! @param theEdge [in] the edge to measure.
//! @param thePlane [in] the user-defined plane
Standard_EXPORT void SetMeasuredGeometry (const TopoDS_Edge& theEdge,
const gp_Pln& thePlane);
//! Measure distance between two faces.
//! The dimension will become invalid if the distance can not
//! be measured or it is less than Precision::Confusion().
//! @param theFirstFace [in] the first face (first shape).
//! @param theSecondFace [in] the second face (second shape).
Standard_EXPORT void SetMeasuredGeometry (const TopoDS_Face& theFirstFace,
const TopoDS_Face& theSecondFace);
//! Measure distance between face and edge.
//! The dimension will become invalid if the distance can not
//! be measured or it is less than Precision::Confusion().
//! @param theFace [in] the face (first shape).
//! @param theEdge [in] the edge (second shape).
Standard_EXPORT void SetMeasuredGeometry (const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge);
//! Measure distance between generic pair of shapes (edges, vertices, length),
//! where measuring is applicable.
//! @param theFirstShape [in] the first shape.
//! @param theSecondShape [in] the second shape.
Standard_EXPORT void SetMeasuredShapes (const TopoDS_Shape& theFirstShape,
const TopoDS_Shape& theSecondShape);
//! @return the display units string.
Standard_EXPORT virtual const TCollection_AsciiString& GetDisplayUnits() const;
//! @return the model units string.
Standard_EXPORT virtual const TCollection_AsciiString& GetModelUnits() const;
Standard_EXPORT virtual void SetDisplayUnits (const TCollection_AsciiString& theUnits);
Standard_EXPORT virtual void SetModelUnits (const TCollection_AsciiString& theUnits);
Standard_EXPORT virtual void SetTextPosition (const gp_Pnt& theTextPos);
Standard_EXPORT virtual const gp_Pnt GetTextPosition() const;
public:
DEFINE_STANDARD_RTTI(AIS_LengthDimension)
protected:
//! Checks if the plane includes first and second points to build dimension.
Standard_EXPORT virtual Standard_Boolean CheckPlane (const gp_Pln& thePlane) const;
Standard_EXPORT virtual gp_Pln ComputePlane(const gp_Dir& theAttachDir) const;
Standard_EXPORT Standard_Real ComputeValue() const;
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
const Handle(Prs3d_Presentation)& thePresentation,
const Standard_Integer theMode = 0);
Standard_EXPORT virtual void ComputeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection,
const Handle(SelectMgr_EntityOwner)& theEntityOwner);
protected:
//! Checks that distance between two points is valid.
//! @param theFirstPoint [in] the first point.
//! @param theSecondPoint [in] the second point.
Standard_EXPORT Standard_Boolean IsValidPoints (const gp_Pnt& theFirstPoint,
const gp_Pnt& theSecondPoint) const;
Standard_EXPORT Standard_Boolean InitTwoEdgesLength (const TopoDS_Edge & theFirstEdge,
const TopoDS_Edge& theSecondEdge,
gp_Dir& theEdgeDir);
//! Auxiliary method for InitTwoShapesPoints()
//! in case of the distance between edge and vertex.
//! Finds the point on the edge that is the closest one to <theVertex>.
//! @param theEdgeDir [out] is the direction on the edge to build
//! automatical plane.
Standard_EXPORT Standard_Boolean InitEdgeVertexLength (const TopoDS_Edge& theEdge,
const TopoDS_Vertex& theVertex,
gp_Dir& theEdgeDir,
Standard_Boolean isInfinite);
//! Auxiliary method for InitTwoShapesPoints()
//! in case of the distance between face and edge.
//! The first attachment point is first parameter point from <theEdge>.
//! Find the second attachment point which belongs to <theFace>
//! Iterate over the edges of the face and find the closest point according
//! to finded point on edge.
//! @param theEdgeDir [out] is the direction on the edge to build
//! automatical plane.
Standard_EXPORT Standard_Boolean InitEdgeFaceLength (const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace,
gp_Dir& theEdgeDir);
//! Initialization of two attach points in case of two owner shapes.
Standard_EXPORT Standard_Boolean InitTwoShapesPoints (const TopoDS_Shape& theFirstShape,
const TopoDS_Shape& theSecondShape,
gp_Pln& theComputedPlane,
Standard_Boolean& theIsPlaneComputed);
//! Initialization of two attach points in case of one owner shape.
Standard_EXPORT Standard_Boolean InitOneShapePoints (const TopoDS_Shape& theShape);
private:
gp_Pnt myFirstPoint;
gp_Pnt mySecondPoint;
TopoDS_Shape myFirstShape;
TopoDS_Shape mySecondShape;
};
#endif // _AIS_LengthDimension_HeaderFile
|