Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-25 09:19:32

0001 // Created on: 1994-10-03
0002 // Created by: Arnaud BOUZY
0003 // Copyright (c) 1994-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 _DsgPrs_HeaderFile
0018 #define _DsgPrs_HeaderFile
0019 
0020 #include <DsgPrs_ArrowSide.hxx>
0021 #include <gp_Circ.hxx>
0022 #include <gp_Elips.hxx>
0023 #include <Prs3d_Presentation.hxx>
0024 
0025 class Geom_Curve;
0026 class Geom_Surface;
0027 class Prs3d_DimensionAspect;
0028 
0029 //! Describes Standard Presentations for DsgIHM objects
0030 class DsgPrs
0031 {
0032 public:
0033   DEFINE_STANDARD_ALLOC
0034 
0035   //! draws symbols ((one or two) arrows,(one or two)points
0036   //! at thebeginning and at the end of the dimension
0037   Standard_EXPORT static void ComputeSymbol(const occ::handle<Prs3d_Presentation>&    aPresentation,
0038                                             const occ::handle<Prs3d_DimensionAspect>& anAspect,
0039                                             const gp_Pnt&                             pt1,
0040                                             const gp_Pnt&                             pt2,
0041                                             const gp_Dir&                             dir1,
0042                                             const gp_Dir&                             dir2,
0043                                             const DsgPrs_ArrowSide                    ArrowSide,
0044                                             const bool drawFromCenter = true);
0045 
0046   Standard_EXPORT static void ComputePlanarFacesLengthPresentation(const double  FirstArrowLength,
0047                                                                    const double  SecondArrowLength,
0048                                                                    const gp_Pnt& AttachmentPoint1,
0049                                                                    const gp_Pnt& AttachmentPoint2,
0050                                                                    const gp_Dir& DirAttach,
0051                                                                    const gp_Pnt& OffsetPoint,
0052                                                                    const gp_Pln& PlaneOfFaces,
0053                                                                    gp_Pnt&       EndOfArrow1,
0054                                                                    gp_Pnt&       EndOfArrow2,
0055                                                                    gp_Dir&       DirOfArrow1);
0056 
0057   Standard_EXPORT static void ComputeCurvilinearFacesLengthPresentation(
0058     const double                     FirstArrowLength,
0059     const double                     SecondArrowLength,
0060     const occ::handle<Geom_Surface>& SecondSurf,
0061     const gp_Pnt&                    AttachmentPoint1,
0062     const gp_Pnt&                    AttachmentPoint2,
0063     const gp_Dir&                    DirAttach,
0064     gp_Pnt&                          EndOfArrow2,
0065     gp_Dir&                          DirOfArrow1,
0066     occ::handle<Geom_Curve>&         VCurve,
0067     occ::handle<Geom_Curve>&         UCurve,
0068     double&                          FirstU,
0069     double&                          deltaU,
0070     double&                          FirstV,
0071     double&                          deltaV);
0072 
0073   Standard_EXPORT static void ComputeFacesAnglePresentation(const double  ArrowLength,
0074                                                             const double  Value,
0075                                                             const gp_Pnt& CenterPoint,
0076                                                             const gp_Pnt& AttachmentPoint1,
0077                                                             const gp_Pnt& AttachmentPoint2,
0078                                                             const gp_Dir& dir1,
0079                                                             const gp_Dir& dir2,
0080                                                             const gp_Dir& axisdir,
0081                                                             const bool    isPlane,
0082                                                             const gp_Ax1& AxisOfSurf,
0083                                                             const gp_Pnt& OffsetPoint,
0084                                                             gp_Circ&      AngleCirc,
0085                                                             double&       FirstParAngleCirc,
0086                                                             double&       LastParAngleCirc,
0087                                                             gp_Pnt&       EndOfArrow1,
0088                                                             gp_Pnt&       EndOfArrow2,
0089                                                             gp_Dir&       DirOfArrow1,
0090                                                             gp_Dir&       DirOfArrow2,
0091                                                             gp_Pnt&       ProjAttachPoint2,
0092                                                             gp_Circ&      AttachCirc,
0093                                                             double&       FirstParAttachCirc,
0094                                                             double&       LastParAttachCirc);
0095 
0096   Standard_EXPORT static void ComputeRadiusLine(const gp_Pnt& aCenter,
0097                                                 const gp_Pnt& anEndOfArrow,
0098                                                 const gp_Pnt& aPosition,
0099                                                 const bool    drawFromCenter,
0100                                                 gp_Pnt&       aRadLineOrign,
0101                                                 gp_Pnt&       aRadLineEnd);
0102 
0103   //! computes Geometry for fillet radius presentation;
0104   //! special case flag SpecCase equal true if
0105   //! radius of fillet circle = 0 or if angle between
0106   //! Vec1(Center, FirstPoint) and Vec2(Center,SecondPoint) equal 0 or PI
0107   Standard_EXPORT static void ComputeFilletRadiusPresentation(const double  ArrowLength,
0108                                                               const double  Value,
0109                                                               const gp_Pnt& Position,
0110                                                               const gp_Dir& NormalDir,
0111                                                               const gp_Pnt& FirstPoint,
0112                                                               const gp_Pnt& SecondPoint,
0113                                                               const gp_Pnt& Center,
0114                                                               const gp_Pnt& BasePnt,
0115                                                               const bool    drawRevers,
0116                                                               bool&         SpecCase,
0117                                                               gp_Circ&      FilletCirc,
0118                                                               double&       FirstParCirc,
0119                                                               double&       LastParCirc,
0120                                                               gp_Pnt&       EndOfArrow,
0121                                                               gp_Dir&       DirOfArrow,
0122                                                               gp_Pnt&       DrawPosition);
0123 
0124   //! computes length of ellipse arc in parametric units
0125   Standard_EXPORT static double DistanceFromApex(const gp_Elips& elips,
0126                                                  const gp_Pnt&   Apex,
0127                                                  const double    par);
0128 };
0129 
0130 #endif // _DsgPrs_HeaderFile