|
Rhino C++ API
9.0
|
#include <opennurbs_mesh.h>
Public Types | |
| enum | : unsigned int { UnsetDensity = 0, MinimumUserInterfaceDensity = 1, MaximumUserInterfaceDensity = 5, MinimumAdaptiveDensity = 1, MinimumDensity = 0, ExtraCoarseDensity = 1, CoarseDensity = 2, MediumDensity = 3, FineDensity = 4, DefaultDensity = 4, ExtraFineDensity = 5, MaximumDensity = 6 } |
| enum | : unsigned int { AdaptiveDisplayMeshQuadMaximum = 2048000 } |
| enum | Context : unsigned char { Context::Unknown = 0, Context::SubDToMesh = 1, Context::SubDToNURBS = 2 } |
Static Public Member Functions | |
| static unsigned int | AbsoluteDisplayDensityFromSubD (unsigned adaptive_subd_display_density, const class ON_SubD &subd) |
| static unsigned int | AbsoluteDisplayDensityFromSubDFaceCount (unsigned adaptive_subd_display_density, unsigned subd_face_count) |
| DEPRECATED - DO NOT USE BEST: Call ON_SubDDisplayParameters::AbsoluteDisplayDensityFromSubD(). BETTER: Call ON_SubDDisplayParameters::AbsoluteDisplayDensityFromSubDProperties(). More... | |
| static unsigned int | AbsoluteDisplayDensityFromSubDProperties (unsigned adaptive_subd_display_density, unsigned subd_face_count, bool bHasSharpEdges) |
| Convert an "adaptive" display_density to an absolute density. For ordinary sized SubDs with no sharp edges, the returned absolute display density is equal to the adaptive display density. For ordinary sized SubDs with sharp edges, the returned absolute display density is equal to the 1 + adaptive display density. For SubDs with sharp edges, this increase means the sharp edges are rendered more accurately. For large SubDs the absolute density is reduced a bit to keep the overall number of fragment quads small enough that common current rendering technology can handle them. The generation of the fragments is typically much faster than rendering the resulting mesh; rendering and/or wasteful conversions to ON_Mesh are the typical bottlenecks. More... | |
| static int | CompareDisplayDensity (const class ON_SubD &subd, const ON_SubDDisplayParameters &a, const ON_SubDDisplayParameters &b, bool bCompareComputeCurvature) |
| static const ON_SubDDisplayParameters | CreateFromAbsoluteDisplayDensity (unsigned int absolute_subd_display_density) |
| static const ON_SubDDisplayParameters | CreateFromDisplayDensity (unsigned int adaptive_subd_display_density) |
| static const ON_SubDDisplayParameters | CreateFromMeshDensity (double normalized_mesh_density) |
| static const ON_SubDDisplayParameters | DecodeFromUnsignedChar (unsigned char encoded_parameters) |
Static Public Attributes | |
| static const ON_SubDDisplayParameters | Coarse |
| static const ON_SubDDisplayParameters | Default |
| static const ON_SubDDisplayParameters | Empty |
| static const ON_SubDDisplayParameters | ExtraCoarse |
| static const ON_SubDDisplayParameters | ExtraFine |
| static const ON_SubDDisplayParameters | Fine |
| static const ON_SubDDisplayParameters | Medium |
A collection of parameters that are passed to functions that calculate a various representations of ON_SubD objects.
| anonymous enum : unsigned int |
| anonymous enum : unsigned int |
|
strong |
| Enumerator | |
|---|---|
| Unknown | summary> Unknown, unspecified, or unset context. This is typical. /summary> summary> These parameters are being used to generate a quad mesh approximations of an ON_SubD. Low level meshing code copies input parameters and specifies this context when appropriate. /summary> |
| SubDToMesh | summary> These parameters are being used to generate NURBS surface approximations of an ON_SubD. Low level conversion to NURB code copies input parameters and specifies this context when appropriate. /summary> |
| SubDToNURBS | |
|
default |
|
default |
|
default |
|
static |
Parameters: adaptive_subd_display_density - [in] A value <= ON_SubDDisplayParameters::MaximumDensity. When in doubt, pass ON_SubDDisplayParameters::DefaultDensity. Invalid input values are treated as ON_SubDDisplayParameters::DefaultDensity. subd - [in] In the cases when the subd in question is not available, like user interface code that applies in general and to unknown SubDs, pass ON_SubD::Empty. Returns: The absolute SubD display density for subd. The absolute SubD display density is <= adaptive_subd_display_density and <= ON_SubDDisplayParameters::MaximumDensity.
|
static |
DEPRECATED - DO NOT USE BEST: Call ON_SubDDisplayParameters::AbsoluteDisplayDensityFromSubD(). BETTER: Call ON_SubDDisplayParameters::AbsoluteDisplayDensityFromSubDProperties().
|
static |
Convert an "adaptive" display_density to an absolute density. For ordinary sized SubDs with no sharp edges, the returned absolute display density is equal to the adaptive display density. For ordinary sized SubDs with sharp edges, the returned absolute display density is equal to the 1 + adaptive display density. For SubDs with sharp edges, this increase means the sharp edges are rendered more accurately. For large SubDs the absolute density is reduced a bit to keep the overall number of fragment quads small enough that common current rendering technology can handle them. The generation of the fragments is typically much faster than rendering the resulting mesh; rendering and/or wasteful conversions to ON_Mesh are the typical bottlenecks.
| adaptive_subd_display_density | 0 <= adaptive_subd_display_density <= ON_SubDDisplayParameters::MaximumDensity. Invalid input values are treated as ON_SubDDisplayParameters::DefaultDensity. When in doubt, pass ON_SubDDisplayParameters::DefaultDensity. Do not adjust the adaptive_subd_display_density parameter based on the presense of sharp edges. When bHasSharpEdges is true, the caluculation in AbsoluteDisplayDensityFromSubDProperties() will increases the returned absolute display density by one. |
| subd_face_count | Number of SubD faces. When subd_face_count is very large, the returned absolute display density is smaller than the input adaptive_subd_display_density to attempt to keep the total number of mesh quads that need to be renderered <= ON_SubDDisplayParameters::AdaptiveDisplayMeshQuadMaximum. |
Details: Set D = adaptive_subd_display_density + (bHasSharpEdges?1:0). Set M = ON_SubDDisplayParameters::AdaptiveDisplayMeshQuadMaximum/(4^D)). The same absoluted display density D is returned for all face counts in the range 0 <= subd_face_count <= M. When subd_face_count > M, the returned absolute display density is reduced to a level where the resulting number of mesh quads will be <= ON_SubDDisplayParameters::AdaptiveDisplayMeshQuadMaximum.
| bHasSharpEdges | Pass true if the SubD has sharp edges. For ordinary sized SubDs, when bHasSharpEdges is true, adaptive_subd_display_density + 1 is returned and when bHasSharpEdges is false, adaptive_subd_display_density is returned. For large SubDs, see the Details section of the subd_face_count documentation. |
|
static |
| bool ON_SubDDisplayParameters::ComputeCurvature | ( | ) | const |
Description: The ComputeCurvature() property determines if the mesh has curvature values.
| ON_SubDDisplayParameters::Context ON_SubDDisplayParameters::ContextForExperts | ( | ) | const |
Description: Low level mesh creation and ON_SubD to NURBS conversion code occasional looks at the context. Typically it is set in a local copy and no user of the top level ON_SubD SDK needs to be concerned about the context setting. This setting is not saved in 3dm archives and is ignored by all compare functions.
|
static |
Description: Use of absolute display density is strongly discouraged. SubDs can have a single face or millions of faces. Adaptive display meshing produces more desirable results in almost all cases. Parameters: absolute_subd_display_density - [in] A value <= ON_SubDDisplayParameters::MaximumDensity. When in doubt, pass ON_SubDDisplayParameters::DefaultDensity. Returns: A ON_SubDDisplayParameters that treats the display density value as a constant for all SubDs.
|
static |
Description: In most applications, the caller sets the mesh_density and leaves the other parameters set to the default values. Parameters: adaptive_subd_display_density - [in] A value <= ON_SubDDisplayParameters::MaximumDensity. When in doubt, pass ON_SubDDisplayParameters::DefaultDensity. Values < ON_SubDDisplayParameters::MinimumAdaptiveDensity are treated as N_SubDDisplayParameters::MinimumAdaptiveDensity. All other invalid input values are treated as ON_SubDDisplayParameters::DefaultDensity. Returns: A ON_SubDDisplayParameters with adaptive SubD display density.
|
static |
Description: This function creates ON_SubDDisplayParameters from a user interface "slider" like Rhino's simple mesh controls. Parameters: normalized_mesh_density - [in] A double between 0.0 and 1.0
The table below shows the correspondence between normalized_density and subd display density.
Mesh density percentage / normalized_mesh_density / subd display density 0% -> [0.0, ON_ZERO_TOLERANCE] -> 1 = adaptive MinimumUserInterfaceDensity 0% to 19% -> (ON_ZERO_TOLERANCE, 0.20) -> 2 = adaptive CoarseDensity 20% to 34% -> [0.20, 0.35) -> 3 = adaptive MediumDensity 35% to 75% -> [0.35, 0.75] -> 4 = adaptive FineDensity 76% to 99% -> (0.75, 1 - ON_ZERO_TOLERANCE) -> 5 = adaptive ExtraFineDensity 100% -> [1 - ON_ZERO_TOLERANCE, 1.0] -> 5 = adaptive MaximumUserInterfaceDensity
Invalid input -> adaptive DefaultDensity;
Returns: A valid ON_SubDDisplayParameters with the specified subd display density.
|
static |
| unsigned int ON_SubDDisplayParameters::DisplayDensity | ( | ) | const |
| unsigned int ON_SubDDisplayParameters::DisplayDensity | ( | const class ON_SubD & | subd | ) | const |
Parameters: subd - [in] Used when the display density is adaptive and subd.FaceCount() > 0. Ignored when the display density is absolute or subd.FaceCount() = 0.
Returns: The absolute display density to use when creating display meshes for subd. When adaptive reduction is enabled, subd.FaceCount() is used to determine the appropriate display density.
Remarks: The chart below shows the relationship between the returned value and the number of display mesh quads a generated by 1 SubD quad.
return display mesh value quads 0 1 = 1x1 1 4 = 2x2 2 16 = 4x4 3 64 = 8x8
4 128 = 16x16 5 1,024 = 32x32 6 4,096 = 64x64
| bool ON_SubDDisplayParameters::DisplayDensityIsAbsolute | ( | ) | const |
Returns: True if the SubD display density setting is absolute. Remarks: this->DensityIsAdaptive() and this->DensityIsAbsolute() always return opposite bool values. Use the one that makes your code easiest to read and understand.
| bool ON_SubDDisplayParameters::DisplayDensityIsAdaptive | ( | ) | const |
Returns: True if the SubD display density setting is adaptive and approximate display mesh quad count is capped at ON_SubDDisplayParameters::AdaptiveDisplayMeshQuadMaximum. Remarks: this->DensityIsAdaptive() and this->DensityIsAbsolute() always return opposite bool values. Use the one that makes your code easiest to read and understand.
| void ON_SubDDisplayParameters::Dump | ( | class ON_TextLog & | ) | const |
| unsigned char ON_SubDDisplayParameters::EncodeAsUnsignedChar | ( | ) | const |
| const unsigned char ON_SubDDisplayParameters::GetRawDisplayDensityForExperts | ( | ) | const |
Returns: The raw value of m_display_density. Remarks: This function is only intended to get public raw access to that value (for example when comparing meshing parameters) and should not be used in any place where the returned value will be used to compute a SubD display density.
Use DisplayDensity(subd) instead!
| ON_SubDComponentLocation ON_SubDDisplayParameters::MeshLocation | ( | ) | const |
Description: The MeshLocation() property determines if the mesh is on the SubD's control net or the SubD's surface.
|
default |
| ON_ProgressReporter* ON_SubDDisplayParameters::ProgressReporter | ( | ) | const |
| const ON_Interval ON_SubDDisplayParameters::ProgressReporterInterval | ( | ) | const |
| bool ON_SubDDisplayParameters::Read | ( | class ON_BinaryArchive & | archive | ) |
| void ON_SubDDisplayParameters::SetAbsoluteDisplayDensity | ( | unsigned int | absolute_display_density | ) |
Description: In almost all cases, you are better off using SetAdaptiveDisplayDensity(). Parameters: absolute_display_density - [in] absolute_display_density <= ON_SubDDisplayParameters::MaximumDensity Remarks: The use of this setting
| void ON_SubDDisplayParameters::SetAdaptiveDisplayDensity | ( | unsigned int | adaptive_display_density | ) |
Description: Set an adaptive SubD display density that caps display mesh quad count at ON_SubDDisplayParameters::AdaptiveDisplayMeshQuadMaximum. Parameters: adaptive_display_density - [in] adaptive_display_density <= ON_SubDDisplayParameters::MaximumDensity Values <= ON_SubDDisplayParameters::MinimumAdaptiveDensity will never be adaptively reduced during display mesh creation. Remarks: The use of this setting
| void ON_SubDDisplayParameters::SetComputeCurvature | ( | bool | compute_curvature | ) |
Description: The ComputeCurvature() property determines if the mesh has curvature values. Parameters: compute_curvature - [in]
| void ON_SubDDisplayParameters::SetContextForExperts | ( | ON_SubDDisplayParameters::Context | context | ) |
| void ON_SubDDisplayParameters::SetDisplayDensity | ( | unsigned int | adaptive_display_density | ) |
| void ON_SubDDisplayParameters::SetMeshLocation | ( | ON_SubDComponentLocation | mesh_location | ) |
Description: The MeshLocation() property determines if the mesh is on the SubD's control net or the SubD's surface. Parameters: mesh_location - [in]
| void ON_SubDDisplayParameters::SetProgressReporter | ( | ON_ProgressReporter * | progress_reporter, |
| ON_Interval | progress_reporter_interval | ||
| ) |
| void ON_SubDDisplayParameters::SetTerminator | ( | ON_Terminator * | terminator | ) |
| ON_Terminator* ON_SubDDisplayParameters::Terminator | ( | ) | const |
TODO - split this class into two - what's above and one derived from that with what's below.
| bool ON_SubDDisplayParameters::Write | ( | class ON_BinaryArchive & | archive | ) | const |
|
static |
Parameters for a course limit surface display mesh. SubD display density = adaptive ON_SubDDisplayParameters::CoarseDensity
|
static |
Parameters for the default limit surface display mesh. SubD display density = adaptive ON_SubDDisplayParameters::DefaultDensity
|
static |
|
static |
Parameters for a course limit surface display mesh. SubD display density = adaptive ON_SubDDisplayParameters::ExtraCoarseDensity
|
static |
Parameters for an extra fine limit surface display mesh. SubD display density = adaptive ON_SubDDisplayParameters::ExtraFineDensity
|
static |
Parameters for the default limit surface display mesh. Produces and acceptable rendering of the SubD Rhino logo. SubD display density = adaptive ON_SubDDisplayParameters::FineDensity (default)
|
static |
Parameters for a medium limit surface display mesh. SubD display density = adaptive ON_SubDDisplayParameters::MediumDensity Too crude for a quality rendering of the SubD Rhino logo.
1.8.17