// Copyright (c) 1995-1999 Matra Datavision // Copyright (c) 1999-2012 OPEN CASCADE SAS // // The content of this file is subject to the Open CASCADE Technology Public // License Version 6.5 (the "License"). You may not use the content of this file // except in compliance with the License. Please obtain a copy of the License // at http://www.opencascade.org and read it completely before using this file. // // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. // // The Original Code and all software distributed under the License is // distributed on an "AS IS" basis, without warranty of any kind, and the // Initial Developer hereby disclaims all such warranties, including without // limitation, any warranties of merchantability, fitness for a particular // purpose or non-infringement. Please see the License for the specific terms // and conditions governing the rights and limitations under the License. #ifndef _AIS_DiameterDimension_HeaderFile #define _AIS_DiameterDimension_HeaderFile #include #include #include #include #include #include #include DEFINE_STANDARD_HANDLE(AIS_DiameterDimension,AIS_Dimension) //! A framework to display diameter dimensions.
//! A diameter is displayed with arrows and text. The
//! text gives the length of the diameter.
//! The algorithm takes a length along a face and
//! analyzes it as an arc. It then reconstructs the circle
//! corresponding to the arc and calculates the
//! diameter of this circle. This diameter serves as a
//! relational reference in 3d presentations of the surface.
class AIS_DiameterDimension : public AIS_Dimension { public: //! Constructs a diameter display object defined by the
//! circle Standard_EXPORT AIS_DiameterDimension(const gp_Circ& theCircle); //! Consctructor that allows to set a attach point
//! on the circle where to attach dimension Standard_EXPORT AIS_DiameterDimension (const gp_Circ& theCircle, const gp_Pnt& theAttachPoint); Standard_EXPORT AIS_DiameterDimension (const gp_Circ& theCircle, const Handle(Prs3d_DimensionAspect)& theDimensionStyle, const Standard_Real theExtensionSize = 1.0); Standard_EXPORT AIS_DiameterDimension (const TopoDS_Shape& theShape); Standard_EXPORT void SetFlyout(const Standard_Real theFlyout); Standard_EXPORT Standard_Real GetFlyout () const; DEFINE_STANDARD_RTTI(AIS_DiameterDimension) protected: Standard_EXPORT virtual void computeValue (); //! Fills default plane object if it is possible to count plane automatically. Standard_EXPORT virtual void countDefaultPlane (); private: virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0); // Fields //! Defines flyout lines and direction //! Flyout direction in the working plane (stored in the base AIS_Dimension). //! can be negative , or positive and is defined by the sign of value. //! The direction vector is counting using the working plane. //! value defined the size of flyout. Standard_Real myFlyout; gp_Circ myCircle; }; #endif