opennurbs_detail.h
1 /* $NoKeywords: $ */
2 /*
3 //
4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
6 // McNeel & Associates.
7 //
8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
11 //
12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
13 //
14 ////////////////////////////////////////////////////////////////
15 */
16 
17 #if !defined(ON_DETAIL_OBJECTY_INC_)
18 #define ON_DETAIL_OBJECTY_INC_
19 
20 class ON_CLASS ON_DetailView : public ON_Geometry
21 {
22  ON_OBJECT_DECLARE(ON_DetailView);
23 
24 public:
25  ON_DetailView();
26  ~ON_DetailView();
27 
28  // C++ defaults for copy constructor and
29  // operator= work fine.
30 
31  //////////////////////////////////////////////////////
32  //
33  // virtual ON_Object overrides
34  //
35  void MemoryRelocate() override;
36 
37  bool IsValid( class ON_TextLog* text_log = nullptr ) const override;
38 
39  void Dump( ON_TextLog& ) const override;
40 
41  unsigned int SizeOf() const override;
42 
43  bool Write(
44  ON_BinaryArchive& binary_archive
45  ) const override;
46 
47  bool Read(
48  ON_BinaryArchive& binary_archive
49  ) override;
50 
51  ON::object_type ObjectType() const override; // returns ON::detail_object
52 
53  //////////////////////////////////////////////////////
54  //
55  // virtual ON_Geometry overrides
56  // The m_boundary determines all bounding boxes
57  //
58  int Dimension() const override;
59 
60  // virtual ON_Geometry GetBBox override
61  bool GetBBox( double* boxmin, double* boxmax, bool bGrowBox = false ) const override;
62 
63  // virtual ON_Geometry GetTightBoundingBox override
64  bool GetTightBoundingBox( class ON_BoundingBox& tight_bbox, bool bGrowBox = false, const class ON_Xform* xform = nullptr ) const override;
65 
66  bool Transform( const ON_Xform& xform ) override;
67 
68  // m_page_per_model_ratio is the ratio of page length / model length
69  // where both lengths are in the same unit system
70  // (ex. 1/4" on page = 1' in model = 0.25/12 = 0.02083)
71  // ( 1mm on page = 1m in model = 1/1000 = 0.001)
72  // If m_page_per_model_ratio > 0.0, then the detail
73  // is drawn using the specified scale.
75 
76  // A view with ON_3dmView::m_view_type = ON::nested_view_type
77  // This field is used for IO purposes only. Runtime detail
78  // view projection information is on CRhDetailViewObject.
80 
81  // 2d curve in page layout coordinates in mm
82  // (0,0) = lower left corner of page
84 };
85 
86 
87 
88 #endif
89 
virtual bool Transform(const ON_Xform &xform)
Transforms the object.
virtual void MemoryRelocate()
The MemoryRelocate() function is called when an object&#39;s location in memory is changed. For example, if an object resides in a chunk of memory that is grown by calling a realloc that has to allocate a new chunk and copy the contents of the old chunk to the new chunk, then the location of the object&#39;s memory changes. In practice this happens when classes derived from ON_Object are stored in dynamic arrays, like the default implementation of ON_ObjectArray<>&#39;s that use realloc to grow the dynamic array.
virtual int Dimension() const
Dimension of the object.
virtual bool GetBBox(double *boxmin, double *boxmax, bool bGrowBox=false) const
This is the virtual function that actually calculates axis aligned bounding boxes.
Definition: opennurbs_detail.h:20
ON_3dmView m_view
Definition: opennurbs_detail.h:79
Definition: opennurbs_3dm_settings.h:523
virtual ON::object_type ObjectType() const
Useful for switch statements that need to differentiate between basic object types like points...
Base class for all geometry classes that must provide runtime class id. Provides interface for common...
Definition: opennurbs_geometry.h:37
virtual bool GetTightBoundingBox(class ON_BoundingBox &tight_bbox, bool bGrowBox=false, const class ON_Xform *xform=nullptr) const
Get tight bounding box.
virtual unsigned int SizeOf() const
Definition: opennurbs_bounding_box.h:25
ON_NurbsCurve m_boundary
Definition: opennurbs_detail.h:83
Definition: opennurbs_xform.h:28
virtual void Dump(ON_TextLog &) const
Creates a text dump of the object.
double m_page_per_model_ratio
Definition: opennurbs_detail.h:74
Definition: opennurbs_nurbscurve.h:26
Definition: opennurbs_textlog.h:20
Definition: opennurbs_archive.h:1783
virtual bool Read(ON_BinaryArchive &binary_archive)
Low level archive writing tool used by ON_BinaryArchive::ReadObject().
bool IsValid(class ON_TextLog *text_log=nullptr) const override
Tests an object to see if its data members are correctly initialized.
virtual bool Write(ON_BinaryArchive &binary_archive) const
Low level archive writing tool used by ON_BinaryArchive::WriteObject().