Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:54

0001 // Created on: 1997-01-21
0002 // Created by: Prestataire Christiane ARMAND
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _AIS_Circle_HeaderFile
0018 #define _AIS_Circle_HeaderFile
0019 
0020 #include <AIS_InteractiveObject.hxx>
0021 
0022 class Geom_Circle;
0023 
0024 //! Constructs circle datums to be used in construction of
0025 //! composite shapes.
0026 class AIS_Circle : public AIS_InteractiveObject
0027 {
0028   DEFINE_STANDARD_RTTIEXT(AIS_Circle, AIS_InteractiveObject)
0029 public:
0030 
0031   //! Initializes this algorithm for constructing AIS circle
0032   //! datums initializes the circle aCircle
0033   Standard_EXPORT AIS_Circle(const Handle(Geom_Circle)& aCircle);
0034   
0035   //! Initializes this algorithm for constructing AIS circle datums.
0036   //! Initializes the circle theCircle, the arc
0037   //! starting point theUStart, the arc ending point theUEnd,
0038   //! and the type of sensitivity theIsFilledCircleSens.
0039   Standard_EXPORT AIS_Circle(const Handle(Geom_Circle)& theCircle, const Standard_Real theUStart, const Standard_Real theUEnd, const Standard_Boolean theIsFilledCircleSens = Standard_False);
0040 
0041   //! Returns index 6 by default.
0042   virtual Standard_Integer Signature() const Standard_OVERRIDE { return 6; }
0043 
0044   //! Indicates that the type of Interactive Object is a datum.
0045   virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KindOfInteractive_Datum; }
0046 
0047   //! Returns the circle component defined in SetCircle.
0048   const Handle(Geom_Circle)& Circle() const { return myComponent; }
0049 
0050   //! Constructs instances of the starting point and the end
0051   //! point parameters, theU1 and theU2.
0052   void Parameters (Standard_Real& theU1, Standard_Real& theU2) const
0053   {
0054     theU1 = myUStart;
0055     theU2 = myUEnd;
0056   }
0057 
0058   //! Allows you to provide settings for the circle datum aCircle.
0059   void SetCircle (const Handle(Geom_Circle)& theCircle) { myComponent = theCircle; }
0060 
0061   //! Allows you to set the parameter theU for the starting point of an arc.
0062   void SetFirstParam (const Standard_Real theU)
0063   {
0064     myUStart = theU;
0065     myCircleIsArc = Standard_True;
0066   }
0067 
0068   //! Allows you to provide the parameter theU for the end point of an arc.
0069   void SetLastParam (const Standard_Real theU)
0070   {
0071     myUEnd = theU;
0072     myCircleIsArc = Standard_True;
0073   }
0074 
0075   Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
0076   
0077   //! Assigns the width aValue to the solid line boundary of the circle datum.
0078   Standard_EXPORT void SetWidth (const Standard_Real aValue) Standard_OVERRIDE;
0079   
0080   //! Removes color from the solid line boundary of the circle datum.
0081   Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
0082   
0083   //! Removes width settings from the solid line boundary of the circle datum.
0084   Standard_EXPORT void UnsetWidth() Standard_OVERRIDE;
0085   
0086   //! Returns the type of sensitivity for the circle;
0087   Standard_Boolean IsFilledCircleSens() const { return myIsFilledCircleSens; }
0088 
0089   //! Sets the type of sensitivity for the circle. If theIsFilledCircleSens set to Standard_True
0090   //! then the whole circle will be detectable, otherwise only the boundary of the circle.
0091   void SetFilledCircleSens (const Standard_Boolean theIsFilledCircleSens) { myIsFilledCircleSens = theIsFilledCircleSens; }
0092 
0093 private:
0094 
0095   Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0096                                         const Handle(Prs3d_Presentation)& theprs,
0097                                         const Standard_Integer theMode) Standard_OVERRIDE;
0098 
0099   Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
0100                                                  const Standard_Integer theMode) Standard_OVERRIDE;
0101 
0102   Standard_EXPORT void ComputeCircle (const Handle(Prs3d_Presentation)& aPresentation);
0103 
0104   Standard_EXPORT void ComputeArc (const Handle(Prs3d_Presentation)& aPresentation);
0105 
0106   Standard_EXPORT void ComputeCircleSelection (const Handle(SelectMgr_Selection)& aSelection);
0107 
0108   Standard_EXPORT void ComputeArcSelection (const Handle(SelectMgr_Selection)& aSelection);
0109 
0110   //! Replace aspects of already computed groups with the new value.
0111   void replaceWithNewLineAspect (const Handle(Prs3d_LineAspect)& theAspect);
0112 
0113 private:
0114 
0115   Handle(Geom_Circle) myComponent;
0116   Standard_Real myUStart;
0117   Standard_Real myUEnd;
0118   Standard_Boolean myCircleIsArc;
0119   Standard_Boolean myIsFilledCircleSens;
0120 
0121 };
0122 
0123 DEFINE_STANDARD_HANDLE(AIS_Circle, AIS_InteractiveObject)
0124 
0125 #endif // _AIS_Circle_HeaderFile