File indexing completed on 2024-11-15 09:48:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _Prs3d_Drawer_HeaderFile
0016 #define _Prs3d_Drawer_HeaderFile
0017
0018 #include <Standard.hxx>
0019
0020 #include <Standard_Integer.hxx>
0021 #include <Aspect_TypeOfDeflection.hxx>
0022 #include <Graphic3d_GroupAspect.hxx>
0023 #include <Graphic3d_PresentationAttributes.hxx>
0024 #include <Graphic3d_ShaderProgram.hxx>
0025 #include <Standard_Real.hxx>
0026 #include <Prs3d_VertexDrawMode.hxx>
0027 #include <Prs3d_DimensionUnits.hxx>
0028 #include <Prs3d_TypeOfHLR.hxx>
0029 #include <Standard_Transient.hxx>
0030 #include <GeomAbs_Shape.hxx>
0031
0032 class Prs3d_IsoAspect;
0033 class Prs3d_LineAspect;
0034 class Prs3d_TextAspect;
0035 class Prs3d_ShadingAspect;
0036 class Prs3d_PointAspect;
0037 class Prs3d_PlaneAspect;
0038 class Prs3d_ArrowAspect;
0039 class Prs3d_DatumAspect;
0040 class Prs3d_DimensionAspect;
0041 class TCollection_AsciiString;
0042
0043 DEFINE_STANDARD_HANDLE(Prs3d_Drawer, Graphic3d_PresentationAttributes)
0044
0045
0046
0047
0048 class Prs3d_Drawer : public Graphic3d_PresentationAttributes
0049 {
0050 DEFINE_STANDARD_RTTIEXT(Prs3d_Drawer, Graphic3d_PresentationAttributes)
0051 public:
0052
0053
0054 Standard_EXPORT Prs3d_Drawer();
0055
0056
0057 Standard_EXPORT void SetupOwnDefaults();
0058
0059
0060
0061 Standard_EXPORT void SetTypeOfDeflection (const Aspect_TypeOfDeflection theTypeOfDeflection);
0062
0063
0064
0065 Aspect_TypeOfDeflection TypeOfDeflection() const
0066 {
0067 return myHasOwnTypeOfDeflection || myLink.IsNull()
0068 ? myTypeOfDeflection
0069 : myLink->TypeOfDeflection();
0070 }
0071
0072
0073 Standard_Boolean HasOwnTypeOfDeflection() const { return myHasOwnTypeOfDeflection; }
0074
0075
0076 void UnsetOwnTypeOfDeflection()
0077 {
0078 myHasOwnTypeOfDeflection = false;
0079 myTypeOfDeflection = Aspect_TOD_RELATIVE;
0080 }
0081
0082
0083
0084
0085
0086
0087 void SetMaximalChordialDeviation (const Standard_Real theChordialDeviation)
0088 {
0089 myChordialDeviation = theChordialDeviation;
0090 }
0091
0092
0093
0094 Standard_Real MaximalChordialDeviation() const
0095 {
0096 return myChordialDeviation > 0.0
0097 ? myChordialDeviation
0098 : (!myLink.IsNull()
0099 ? myLink->MaximalChordialDeviation()
0100 : 0.0001);
0101 }
0102
0103
0104 Standard_Boolean HasOwnMaximalChordialDeviation() const { return myChordialDeviation > 0.0; }
0105
0106
0107 void UnsetOwnMaximalChordialDeviation()
0108 {
0109 myChordialDeviation = -1.0;
0110 }
0111
0112
0113 Standard_EXPORT void SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR);
0114
0115
0116 Standard_EXPORT Prs3d_TypeOfHLR TypeOfHLR() const;
0117
0118
0119 Standard_Boolean HasOwnTypeOfHLR() const { return (myTypeOfHLR != Prs3d_TOH_NotSet); }
0120
0121
0122
0123 void SetMaximalParameterValue (const Standard_Real theValue)
0124 {
0125 myMaximalParameterValue = theValue;
0126 }
0127
0128
0129
0130 Standard_Real MaximalParameterValue() const
0131 {
0132 return myMaximalParameterValue > 0.0
0133 ? myMaximalParameterValue
0134 : (!myLink.IsNull()
0135 ? myLink->MaximalParameterValue()
0136 : 500000.0);
0137 }
0138
0139
0140
0141 Standard_Boolean HasOwnMaximalParameterValue() const { return myMaximalParameterValue > 0.0; }
0142
0143
0144 void UnsetOwnMaximalParameterValue()
0145 {
0146 myMaximalParameterValue = -1.0;
0147 }
0148
0149
0150 Standard_EXPORT void SetIsoOnPlane (const Standard_Boolean theIsEnabled);
0151
0152
0153 Standard_Boolean IsoOnPlane() const
0154 {
0155 return myHasOwnIsoOnPlane || myLink.IsNull()
0156 ? myIsoOnPlane
0157 : myLink->IsoOnPlane();
0158 }
0159
0160
0161 Standard_Boolean HasOwnIsoOnPlane() const { return myHasOwnIsoOnPlane; }
0162
0163
0164 void UnsetOwnIsoOnPlane()
0165 {
0166 myHasOwnIsoOnPlane = false;
0167 myIsoOnPlane = false;
0168 }
0169
0170
0171 Standard_Boolean IsoOnTriangulation() const
0172 {
0173 return myHasOwnIsoOnTriangulation || myLink.IsNull()
0174 ? myIsoOnTriangulation
0175 : myLink->IsoOnTriangulation();
0176 }
0177
0178
0179 Standard_Boolean HasOwnIsoOnTriangulation() const { return myHasOwnIsoOnTriangulation; }
0180
0181
0182 void UnsetOwnIsoOnTriangulation()
0183 {
0184 myHasOwnIsoOnTriangulation = false;
0185 myIsoOnTriangulation = false;
0186 }
0187
0188
0189 Standard_EXPORT void SetIsoOnTriangulation (const Standard_Boolean theToEnable);
0190
0191
0192 void SetDiscretisation (const Standard_Integer theValue)
0193 {
0194 myNbPoints = theValue;
0195 }
0196
0197
0198 Standard_Integer Discretisation() const
0199 {
0200 return myNbPoints != -1
0201 ? myNbPoints
0202 : (!myLink.IsNull()
0203 ? myLink->Discretisation()
0204 : 30);
0205 }
0206
0207
0208 Standard_Boolean HasOwnDiscretisation() const { return myNbPoints != -1; }
0209
0210
0211 void UnsetOwnDiscretisation()
0212 {
0213 myNbPoints = -1;
0214 }
0215
0216
0217
0218 Standard_EXPORT void SetDeviationCoefficient (const Standard_Real theCoefficient);
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235
0236 Standard_Real DeviationCoefficient() const
0237 {
0238 return myDeviationCoefficient > 0.0
0239 ? myDeviationCoefficient
0240 : (!myLink.IsNull()
0241 ? myLink->DeviationCoefficient()
0242 : 0.001);
0243 }
0244
0245
0246 void SetDeviationCoefficient()
0247 {
0248 myDeviationCoefficient = -1.0;
0249 }
0250
0251
0252
0253 Standard_Boolean HasOwnDeviationCoefficient() const { return myDeviationCoefficient > 0.0; }
0254
0255
0256
0257 Standard_Real PreviousDeviationCoefficient() const
0258 {
0259 return HasOwnDeviationCoefficient()
0260 ? myPreviousDeviationCoefficient
0261 : 0.0;
0262 }
0263
0264
0265 void UpdatePreviousDeviationCoefficient()
0266 {
0267 if (HasOwnDeviationCoefficient())
0268 {
0269 myPreviousDeviationCoefficient = DeviationCoefficient();
0270 }
0271 }
0272
0273
0274
0275 Standard_EXPORT void SetDeviationAngle (const Standard_Real theAngle);
0276
0277
0278 Standard_Real DeviationAngle() const
0279 {
0280 return myDeviationAngle > 0.0
0281 ? myDeviationAngle
0282 : (!myLink.IsNull()
0283 ? myLink->DeviationAngle()
0284 : 20.0 * M_PI / 180.0);
0285 }
0286
0287
0288 void SetDeviationAngle()
0289 {
0290 myDeviationAngle = -1.0;
0291 }
0292
0293
0294
0295 Standard_Boolean HasOwnDeviationAngle() const { return myDeviationAngle > 0.0; }
0296
0297
0298 Standard_Real PreviousDeviationAngle() const
0299 {
0300 return HasOwnDeviationAngle()
0301 ? myPreviousDeviationAngle
0302 : 0.0;
0303 }
0304
0305
0306 void UpdatePreviousDeviationAngle()
0307 {
0308 if (HasOwnDeviationAngle())
0309 {
0310 myPreviousDeviationAngle = DeviationAngle();
0311 }
0312 }
0313
0314
0315
0316
0317
0318 Standard_EXPORT void SetAutoTriangulation (const Standard_Boolean theIsEnabled);
0319
0320
0321 Standard_Boolean IsAutoTriangulation() const
0322 {
0323 return myHasOwnIsAutoTriangulated || myLink.IsNull()
0324 ? myIsAutoTriangulated
0325 : myLink->IsAutoTriangulation();
0326 }
0327
0328
0329 Standard_Boolean HasOwnIsAutoTriangulation() const { return myHasOwnIsAutoTriangulated; }
0330
0331
0332 void UnsetOwnIsAutoTriangulation()
0333 {
0334 myHasOwnIsAutoTriangulated = false;
0335 myIsAutoTriangulated = true;
0336 }
0337
0338
0339
0340
0341
0342
0343
0344 Standard_EXPORT const Handle(Prs3d_IsoAspect)& UIsoAspect() const;
0345
0346 void SetUIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect)
0347 {
0348 myUIsoAspect = theAspect;
0349 }
0350
0351
0352
0353 Standard_Boolean HasOwnUIsoAspect() const { return !myUIsoAspect.IsNull(); }
0354
0355
0356
0357
0358
0359
0360
0361 Standard_EXPORT const Handle(Prs3d_IsoAspect)& VIsoAspect() const;
0362
0363
0364 void SetVIsoAspect (const Handle(Prs3d_IsoAspect)& theAspect)
0365 {
0366 myVIsoAspect = theAspect;
0367 }
0368
0369
0370
0371 Standard_Boolean HasOwnVIsoAspect() const { return !myVIsoAspect.IsNull(); }
0372
0373
0374
0375 Standard_EXPORT const Handle(Prs3d_LineAspect)& WireAspect() const;
0376
0377
0378 void SetWireAspect (const Handle(Prs3d_LineAspect)& theAspect)
0379 {
0380 myWireAspect = theAspect;
0381 }
0382
0383
0384
0385 Standard_Boolean HasOwnWireAspect() const { return !myWireAspect.IsNull(); }
0386
0387
0388 Standard_EXPORT void SetWireDraw(const Standard_Boolean theIsEnabled);
0389
0390
0391 Standard_Boolean WireDraw() const
0392 {
0393 return myHasOwnWireDraw || myLink.IsNull()
0394 ? myWireDraw
0395 : myLink->WireDraw();
0396 }
0397
0398
0399
0400 Standard_Boolean HasOwnWireDraw() const { return myHasOwnWireDraw; }
0401
0402
0403 void UnsetOwnWireDraw()
0404 {
0405 myHasOwnWireDraw = false;
0406 myWireDraw = true;
0407 }
0408
0409
0410
0411 Standard_EXPORT const Handle(Prs3d_PointAspect)& PointAspect() const;
0412
0413
0414 void SetPointAspect (const Handle(Prs3d_PointAspect)& theAspect)
0415 {
0416 myPointAspect = theAspect;
0417 }
0418
0419
0420
0421 Standard_Boolean HasOwnPointAspect() const { return !myPointAspect.IsNull(); }
0422
0423
0424
0425 Standard_EXPORT Standard_Boolean SetupOwnPointAspect (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
0426
0427
0428
0429
0430
0431
0432 Standard_EXPORT const Handle(Prs3d_LineAspect)& LineAspect() const;
0433
0434
0435 void SetLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
0436 {
0437 myLineAspect = theAspect;
0438 }
0439
0440
0441
0442 Standard_Boolean HasOwnLineAspect() const { return !myLineAspect.IsNull(); }
0443
0444
0445
0446
0447
0448
0449
0450 Standard_EXPORT Standard_Boolean SetOwnLineAspects (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
0451
0452
0453
0454 Standard_EXPORT Standard_Boolean SetOwnDatumAspects (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
0455
0456
0457 Standard_EXPORT const Handle(Prs3d_TextAspect)& TextAspect() const;
0458
0459
0460 void SetTextAspect (const Handle(Prs3d_TextAspect)& theAspect)
0461 {
0462 myTextAspect = theAspect;
0463 }
0464
0465
0466
0467 Standard_Boolean HasOwnTextAspect() const { return !myTextAspect.IsNull(); }
0468
0469
0470 Standard_EXPORT const Handle(Prs3d_ShadingAspect)& ShadingAspect() const;
0471
0472
0473 void SetShadingAspect (const Handle(Prs3d_ShadingAspect)& theAspect)
0474 {
0475 myShadingAspect = theAspect;
0476 }
0477
0478
0479
0480 Standard_Boolean HasOwnShadingAspect() const { return !myShadingAspect.IsNull(); }
0481
0482
0483
0484 Standard_EXPORT Standard_Boolean SetupOwnShadingAspect (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
0485
0486
0487 Standard_EXPORT const Handle(Prs3d_LineAspect)& SeenLineAspect() const;
0488
0489
0490 void SetSeenLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
0491 {
0492 mySeenLineAspect = theAspect;
0493 }
0494
0495
0496
0497 Standard_Boolean HasOwnSeenLineAspect() const { return !mySeenLineAspect.IsNull(); }
0498
0499
0500 Standard_EXPORT const Handle(Prs3d_PlaneAspect)& PlaneAspect() const;
0501
0502
0503 void SetPlaneAspect (const Handle(Prs3d_PlaneAspect)& theAspect)
0504 {
0505 myPlaneAspect = theAspect;
0506 }
0507
0508
0509
0510 Standard_Boolean HasOwnPlaneAspect() const { return !myPlaneAspect.IsNull(); }
0511
0512
0513 Standard_EXPORT const Handle(Prs3d_ArrowAspect)& ArrowAspect() const;
0514
0515
0516 void SetArrowAspect (const Handle(Prs3d_ArrowAspect)& theAspect)
0517 {
0518 myArrowAspect = theAspect;
0519 }
0520
0521
0522
0523 Standard_Boolean HasOwnArrowAspect() const { return !myArrowAspect.IsNull(); }
0524
0525
0526
0527 Standard_EXPORT void SetLineArrowDraw (const Standard_Boolean theIsEnabled);
0528
0529
0530
0531 Standard_Boolean LineArrowDraw() const
0532 {
0533 return myHasOwnLineArrowDraw || myLink.IsNull()
0534 ? myLineArrowDraw
0535 : myLink->LineArrowDraw();
0536 }
0537
0538
0539
0540 Standard_Boolean HasOwnLineArrowDraw() const { return myHasOwnLineArrowDraw; }
0541
0542
0543 void UnsetOwnLineArrowDraw()
0544 {
0545 myHasOwnLineArrowDraw = false;
0546 myLineArrowDraw = false;
0547 }
0548
0549
0550 Standard_EXPORT const Handle(Prs3d_LineAspect)& HiddenLineAspect() const;
0551
0552
0553 void SetHiddenLineAspect (const Handle(Prs3d_LineAspect)& theAspect)
0554 {
0555 myHiddenLineAspect = theAspect;
0556 }
0557
0558
0559
0560 Standard_Boolean HasOwnHiddenLineAspect() const { return !myHiddenLineAspect.IsNull(); }
0561
0562
0563
0564 Standard_Boolean DrawHiddenLine() const
0565 {
0566 return myHasOwnDrawHiddenLine || myLink.IsNull()
0567 ? myDrawHiddenLine
0568 : myLink->DrawHiddenLine();
0569 }
0570
0571
0572 Standard_EXPORT void EnableDrawHiddenLine();
0573
0574
0575 Standard_EXPORT void DisableDrawHiddenLine();
0576
0577
0578
0579 Standard_Boolean HasOwnDrawHiddenLine() const { return myHasOwnDrawHiddenLine; }
0580
0581
0582 void UnsetOwnDrawHiddenLine()
0583 {
0584 myHasOwnDrawHiddenLine = false;
0585 myDrawHiddenLine = false;
0586 }
0587
0588
0589 Standard_EXPORT const Handle(Prs3d_LineAspect)& VectorAspect() const;
0590
0591
0592 void SetVectorAspect (const Handle(Prs3d_LineAspect)& theAspect)
0593 {
0594 myVectorAspect = theAspect;
0595 }
0596
0597
0598
0599 Standard_Boolean HasOwnVectorAspect() const { return !myVectorAspect.IsNull(); }
0600
0601
0602
0603
0604
0605
0606
0607 Standard_EXPORT void SetVertexDrawMode (const Prs3d_VertexDrawMode theMode);
0608
0609
0610 Standard_EXPORT Prs3d_VertexDrawMode VertexDrawMode() const;
0611
0612
0613
0614
0615 Standard_Boolean HasOwnVertexDrawMode() const { return (myVertexDrawMode != Prs3d_VDM_Inherited); }
0616
0617
0618 Standard_EXPORT const Handle(Prs3d_DatumAspect)& DatumAspect() const;
0619
0620
0621 void SetDatumAspect (const Handle(Prs3d_DatumAspect)& theAspect)
0622 {
0623 myDatumAspect = theAspect;
0624 }
0625
0626
0627
0628 Standard_Boolean HasOwnDatumAspect() const { return !myDatumAspect.IsNull(); }
0629
0630
0631
0632 Standard_EXPORT const Handle(Prs3d_LineAspect)& SectionAspect() const;
0633
0634
0635 void SetSectionAspect (const Handle(Prs3d_LineAspect)& theAspect)
0636 {
0637 mySectionAspect = theAspect;
0638 }
0639
0640
0641
0642 Standard_Boolean HasOwnSectionAspect() const { return !mySectionAspect.IsNull(); }
0643
0644
0645
0646
0647 void SetFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
0648 {
0649 myFreeBoundaryAspect = theAspect;
0650 }
0651
0652
0653
0654
0655 Standard_EXPORT const Handle(Prs3d_LineAspect)& FreeBoundaryAspect() const;
0656
0657
0658
0659 Standard_Boolean HasOwnFreeBoundaryAspect() const { return !myFreeBoundaryAspect.IsNull(); }
0660
0661
0662
0663
0664
0665
0666 Standard_EXPORT void SetFreeBoundaryDraw (const Standard_Boolean theIsEnabled);
0667
0668
0669
0670 Standard_Boolean FreeBoundaryDraw() const
0671 {
0672 return myHasOwnFreeBoundaryDraw || myLink.IsNull()
0673 ? myFreeBoundaryDraw
0674 : myLink->FreeBoundaryDraw();
0675 }
0676
0677
0678
0679 Standard_Boolean HasOwnFreeBoundaryDraw() const { return myHasOwnFreeBoundaryDraw; }
0680
0681
0682 void UnsetOwnFreeBoundaryDraw()
0683 {
0684 myHasOwnFreeBoundaryDraw = false;
0685 myFreeBoundaryDraw = true;
0686 }
0687
0688
0689
0690
0691 void SetUnFreeBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
0692 {
0693 myUnFreeBoundaryAspect = theAspect;
0694 }
0695
0696
0697
0698 Standard_EXPORT const Handle(Prs3d_LineAspect)& UnFreeBoundaryAspect() const;
0699
0700
0701
0702 Standard_Boolean HasOwnUnFreeBoundaryAspect() const { return !myUnFreeBoundaryAspect.IsNull(); }
0703
0704
0705
0706
0707
0708 Standard_EXPORT void SetUnFreeBoundaryDraw (const Standard_Boolean theIsEnabled);
0709
0710
0711
0712 Standard_Boolean UnFreeBoundaryDraw() const
0713 {
0714 return myHasOwnUnFreeBoundaryDraw || myLink.IsNull()
0715 ? myUnFreeBoundaryDraw
0716 : myLink->UnFreeBoundaryDraw();
0717 }
0718
0719
0720
0721 Standard_Boolean HasOwnUnFreeBoundaryDraw() const { return myHasOwnUnFreeBoundaryDraw; }
0722
0723
0724 void UnsetOwnUnFreeBoundaryDraw()
0725 {
0726 myHasOwnUnFreeBoundaryDraw = false;
0727 myUnFreeBoundaryDraw = true;
0728 }
0729
0730
0731
0732
0733
0734 void SetFaceBoundaryAspect (const Handle(Prs3d_LineAspect)& theAspect)
0735 {
0736 myFaceBoundaryAspect = theAspect;
0737 }
0738
0739
0740 Standard_EXPORT const Handle(Prs3d_LineAspect)& FaceBoundaryAspect() const;
0741
0742
0743
0744 Standard_Boolean HasOwnFaceBoundaryAspect() const { return !myFaceBoundaryAspect.IsNull(); }
0745
0746
0747
0748 Standard_EXPORT Standard_Boolean SetupOwnFaceBoundaryAspect (const Handle(Prs3d_Drawer)& theDefaults = Handle(Prs3d_Drawer)());
0749
0750
0751
0752
0753
0754 Standard_EXPORT void SetFaceBoundaryDraw (const Standard_Boolean theIsEnabled);
0755
0756
0757 Standard_Boolean FaceBoundaryDraw() const
0758 {
0759 return myHasOwnFaceBoundaryDraw || myLink.IsNull()
0760 ? myFaceBoundaryDraw
0761 : myLink->FaceBoundaryDraw();
0762 }
0763
0764
0765
0766 Standard_Boolean HasOwnFaceBoundaryDraw() const { return myHasOwnFaceBoundaryDraw; }
0767
0768
0769 void UnsetOwnFaceBoundaryDraw()
0770 {
0771 myHasOwnFaceBoundaryDraw = false;
0772 myFaceBoundaryDraw = false;
0773 }
0774
0775
0776 Standard_Boolean HasOwnFaceBoundaryUpperContinuity() const { return myFaceBoundaryUpperContinuity != -1; }
0777
0778
0779 GeomAbs_Shape FaceBoundaryUpperContinuity() const
0780 {
0781 return HasOwnFaceBoundaryUpperContinuity()
0782 ? (GeomAbs_Shape )myFaceBoundaryUpperContinuity
0783 : (!myLink.IsNull()
0784 ? myLink->FaceBoundaryUpperContinuity()
0785 : GeomAbs_CN);
0786 }
0787
0788
0789 void SetFaceBoundaryUpperContinuity (GeomAbs_Shape theMostAllowedEdgeClass) { myFaceBoundaryUpperContinuity = theMostAllowedEdgeClass; }
0790
0791
0792 void UnsetFaceBoundaryUpperContinuity() { myFaceBoundaryUpperContinuity = -1; }
0793
0794
0795 Standard_EXPORT const Handle(Prs3d_DimensionAspect)& DimensionAspect() const;
0796
0797
0798
0799
0800 void SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theAspect)
0801 {
0802 myDimensionAspect = theAspect;
0803 }
0804
0805
0806
0807 Standard_Boolean HasOwnDimensionAspect() const { return !myDimensionAspect.IsNull(); }
0808
0809
0810
0811
0812 Standard_EXPORT void SetDimLengthModelUnits (const TCollection_AsciiString& theUnits);
0813
0814
0815
0816
0817 Standard_EXPORT void SetDimAngleModelUnits (const TCollection_AsciiString& theUnits);
0818
0819
0820 const TCollection_AsciiString& DimLengthModelUnits() const
0821 {
0822 return myHasOwnDimLengthModelUnits || myLink.IsNull()
0823 ? myDimensionModelUnits.GetLengthUnits()
0824 : myLink->DimLengthModelUnits();
0825 }
0826
0827
0828 const TCollection_AsciiString& DimAngleModelUnits() const
0829 {
0830 return myHasOwnDimAngleModelUnits || myLink.IsNull()
0831 ? myDimensionModelUnits.GetAngleUnits()
0832 : myLink->DimAngleModelUnits();
0833 }
0834
0835
0836
0837 Standard_Boolean HasOwnDimLengthModelUnits() const { return myHasOwnDimLengthModelUnits; }
0838
0839
0840 void UnsetOwnDimLengthModelUnits()
0841 {
0842 myHasOwnDimLengthModelUnits = false;
0843 myDimensionModelUnits.SetLengthUnits ("m");
0844 }
0845
0846
0847
0848 Standard_Boolean HasOwnDimAngleModelUnits() const { return myHasOwnDimAngleModelUnits; }
0849
0850
0851 void UnsetOwnDimAngleModelUnits()
0852 {
0853 myHasOwnDimAngleModelUnits = false;
0854 myDimensionModelUnits.SetAngleUnits ("rad");
0855 }
0856
0857
0858
0859
0860 Standard_EXPORT void SetDimLengthDisplayUnits (const TCollection_AsciiString& theUnits);
0861
0862
0863
0864
0865 Standard_EXPORT void SetDimAngleDisplayUnits (const TCollection_AsciiString& theUnits);
0866
0867
0868 const TCollection_AsciiString& DimLengthDisplayUnits() const
0869 {
0870 return myHasOwnDimLengthDisplayUnits || myLink.IsNull()
0871 ? myDimensionDisplayUnits.GetLengthUnits()
0872 : myLink->DimLengthDisplayUnits();
0873 }
0874
0875
0876 const TCollection_AsciiString& DimAngleDisplayUnits() const
0877 {
0878 return myHasOwnDimAngleDisplayUnits || myLink.IsNull()
0879 ? myDimensionDisplayUnits.GetAngleUnits()
0880 : myLink->DimAngleDisplayUnits();
0881 }
0882
0883
0884
0885
0886 Standard_Boolean HasOwnDimLengthDisplayUnits() const { return myHasOwnDimLengthDisplayUnits; }
0887
0888
0889 void UnsetOwnDimLengthDisplayUnits()
0890 {
0891 myHasOwnDimLengthDisplayUnits = false;
0892 myDimensionDisplayUnits.SetLengthUnits ("m");
0893 }
0894
0895
0896
0897
0898 Standard_Boolean HasOwnDimAngleDisplayUnits() const { return myHasOwnDimAngleDisplayUnits; }
0899
0900
0901 void UnsetOwnDimAngleDisplayUnits()
0902 {
0903 myHasOwnDimAngleDisplayUnits = false;
0904 myDimensionDisplayUnits.SetAngleUnits ("deg");
0905 }
0906
0907 public:
0908
0909
0910 const Handle(Prs3d_Drawer)& Link() const { return myLink; }
0911
0912
0913 Standard_Boolean HasLink() const { return !myLink.IsNull(); }
0914
0915
0916 void Link (const Handle(Prs3d_Drawer)& theDrawer) { SetLink (theDrawer); }
0917
0918
0919 void SetLink (const Handle(Prs3d_Drawer)& theDrawer) { myLink = theDrawer; }
0920
0921
0922 Standard_EXPORT void ClearLocalAttributes();
0923
0924
0925
0926
0927
0928
0929
0930 Standard_EXPORT bool SetShaderProgram (const Handle(Graphic3d_ShaderProgram)& theProgram,
0931 const Graphic3d_GroupAspect theAspect,
0932 const bool theToOverrideDefaults = false);
0933
0934
0935 Standard_EXPORT bool SetShadingModel (Graphic3d_TypeOfShadingModel theModel,
0936 bool theToOverrideDefaults = false);
0937
0938
0939 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0940
0941 public:
0942
0943 Standard_DEPRECATED("SetDeviationAngle() should be used instead")
0944 void SetHLRAngle (const Standard_Real theAngle) { SetDeviationAngle (theAngle); }
0945
0946 Standard_DEPRECATED("DeviationAngle() should be used instead")
0947 Standard_Real HLRAngle() const { return DeviationAngle(); }
0948
0949 Standard_DEPRECATED("SetDeviationAngle() should be used instead")
0950 void SetHLRAngle() { SetDeviationAngle(); }
0951
0952 Standard_DEPRECATED("HasOwnDeviationAngle() should be used instead")
0953 Standard_Boolean HasOwnHLRDeviationAngle() const { return HasOwnDeviationAngle(); }
0954
0955 Standard_DEPRECATED("PreviousDeviationAngle() should be used instead")
0956 Standard_Real PreviousHLRDeviationAngle() const { return PreviousDeviationAngle(); }
0957
0958 protected:
0959
0960 Handle(Prs3d_Drawer) myLink;
0961
0962 Standard_Integer myNbPoints;
0963 Standard_Real myMaximalParameterValue;
0964 Standard_Real myChordialDeviation;
0965 Aspect_TypeOfDeflection myTypeOfDeflection;
0966 Standard_Boolean myHasOwnTypeOfDeflection;
0967 Prs3d_TypeOfHLR myTypeOfHLR;
0968 Standard_Real myDeviationCoefficient;
0969 Standard_Real myPreviousDeviationCoefficient;
0970 Standard_Real myDeviationAngle;
0971 Standard_Real myPreviousDeviationAngle;
0972 Standard_Boolean myIsoOnPlane;
0973 Standard_Boolean myHasOwnIsoOnPlane;
0974 Standard_Boolean myIsoOnTriangulation;
0975 Standard_Boolean myHasOwnIsoOnTriangulation;
0976 Standard_Boolean myIsAutoTriangulated;
0977 Standard_Boolean myHasOwnIsAutoTriangulated;
0978
0979 Handle(Prs3d_IsoAspect) myUIsoAspect;
0980 Handle(Prs3d_IsoAspect) myVIsoAspect;
0981 Handle(Prs3d_LineAspect) myWireAspect;
0982 Standard_Boolean myWireDraw;
0983 Standard_Boolean myHasOwnWireDraw;
0984 Handle(Prs3d_PointAspect) myPointAspect;
0985 Handle(Prs3d_LineAspect) myLineAspect;
0986 Handle(Prs3d_TextAspect) myTextAspect;
0987 Handle(Prs3d_ShadingAspect) myShadingAspect;
0988 Handle(Prs3d_PlaneAspect) myPlaneAspect;
0989 Handle(Prs3d_LineAspect) mySeenLineAspect;
0990 Handle(Prs3d_ArrowAspect) myArrowAspect;
0991 Standard_Boolean myLineArrowDraw;
0992 Standard_Boolean myHasOwnLineArrowDraw;
0993 Handle(Prs3d_LineAspect) myHiddenLineAspect;
0994 Standard_Boolean myDrawHiddenLine;
0995 Standard_Boolean myHasOwnDrawHiddenLine;
0996 Handle(Prs3d_LineAspect) myVectorAspect;
0997 Prs3d_VertexDrawMode myVertexDrawMode;
0998 Handle(Prs3d_DatumAspect) myDatumAspect;
0999 Handle(Prs3d_LineAspect) mySectionAspect;
1000
1001 Handle(Prs3d_LineAspect) myFreeBoundaryAspect;
1002 Standard_Boolean myFreeBoundaryDraw;
1003 Standard_Boolean myHasOwnFreeBoundaryDraw;
1004 Handle(Prs3d_LineAspect) myUnFreeBoundaryAspect;
1005 Standard_Boolean myUnFreeBoundaryDraw;
1006 Standard_Boolean myHasOwnUnFreeBoundaryDraw;
1007 Handle(Prs3d_LineAspect) myFaceBoundaryAspect;
1008 Standard_Integer myFaceBoundaryUpperContinuity;
1009 Standard_Boolean myFaceBoundaryDraw;
1010 Standard_Boolean myHasOwnFaceBoundaryDraw;
1011
1012 Handle(Prs3d_DimensionAspect) myDimensionAspect;
1013 Prs3d_DimensionUnits myDimensionModelUnits;
1014 Standard_Boolean myHasOwnDimLengthModelUnits;
1015 Standard_Boolean myHasOwnDimAngleModelUnits;
1016 Prs3d_DimensionUnits myDimensionDisplayUnits;
1017 Standard_Boolean myHasOwnDimLengthDisplayUnits;
1018 Standard_Boolean myHasOwnDimAngleDisplayUnits;
1019 };
1020
1021 #endif