/* $NoKeywords: $ */ /* // // Copyright (c) 1993-2015 Robert McNeel & Associates. All rights reserved. // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert // McNeel & Associates. // // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF // MERCHANTABILITY ARE HEREBY DISCLAIMED. // // For complete openNURBS copyright information see . // //////////////////////////////////////////////////////////////// */ #if !defined(OPENNURBS_TOPOLOGY_INC_) #define OPENNURBS_TOPOLOGY_INC_ class ON_CLASS ON_ComponentAttributes { public: enum : unsigned int { /// /// The Damaged bit is set when an vertex, edge, or face component has a critical data structure flaw. /// Damaged = 0x80000000U }; #pragma region RH_C_SHARED_ENUM [ON_ComponentAttributes::EdgeAttributes] [Rhino.Geometry.EdgeAttributes] [int] /// /// ON_EdgeAttributeFlags are used to report attributes of single edge objects, like /// ON_SubDEdge and ON_BrepEdge, and aggregate edge demographics in objects with topology /// like ON_SubD, ON_Mesh and ON_Brep. /// /// /// /// /// /// enum EdgeAttributes : unsigned int { /// /// The Open bit is set when an edge has distinct start and end vertices. /// Open and Closed are mutually exclusive edge attributes. /// Note that an open edge can have zero length when two distict vertices /// have identical locations and the edge's geometry is a zero length curve. /// Open = 1, /// /// The Closed bit is set when an edge begins and ends at the same vertex. /// Open and Closed are mutually exclusive edge attributes. /// Note that a closed edge can have zero length or nonzero length. /// Closed = 2, /// /// The ZeroLength edge has zero length. It can be open or closed. /// ZeroLength and NonzeroLength are mutually exclusive edge attributes. /// ZeroLength = 4, /// /// The NonzeroLength edge has non zero length. It can be open or closed. /// ZeroLength and NonzeroLength are mutually exclusive edge attributes. /// NonzeroLength = 8, /// /// The Wire edge has no faces. /// Wire, Boundary, Interior, and Nonmanifold are mutually exclusive edge attributes. /// Wire = 16, /// /// The Boundary edge has one face. /// Wire, Boundary, Interior, and Nonmanifold are mutually exclusive edge attributes. /// Boundary = 32, /// /// The Interior edge has two faces. /// Wire, Boundary, Interior, and Nonmanifold are mutually exclusive edge attributes. /// Interior = 64, /// /// The Nonmanifold edge has three or more faces. /// Wire, Boundary, Interior, and Nonmanifold are mutually exclusive edge attributes. /// Nonmanifold = 128, /// /// The InteriorOriented edge has two faces with compatible face orientations. /// InteriorOriented and InteriorNotOriented are mutually exclusive interior edge attributes. /// InteriorOriented = 256, /// /// The InteriorNotOriented edge has two faces with opposite face orientations. /// InteriorOriented and InteriorNotOriented are mutually exclusive interior edge attributes. /// InteriorNotOriented = 512, /// /// The InteriorSmooth edge has two faces with a guaranteed surface tangent continuity. /// InteriorSmooth and InteriorCrease are mutually exclusive interior edge attributes. /// InteriorSmooth = 1024, /// /// The InteriorCrease edge has two faces with a possible surface tangent discontinuity /// InteriorSmooth and InteriorCrease are mutually exclusive interior edge attributes. /// InteriorCrease = 2048, /// /// The InteriorTwoFaced edge has two distinct faces. /// InteriorTwoFaced, InteriorSeam, and InteriorSlit are mutually exclusive interior edge attributes. /// InteriorTwoFaced = 4096, /// /// The InteriorSeam edge has two faces that are identical and the edge is on the parametric boundary of the face's surface. /// InteriorTwoFaced, InteriorSeam, and InteriorSlit are mutually exclusive interior edge attributes. /// /// /// Parametric surfaces that are cylinders are an example of a situation where seam edges occur. /// InteriorSeam = 8192, /// /// The InteriorSlit edge has two faces that are identical and the edges is not a seam. /// InteriorTwoFaced, InteriorSeam, and InteriorSlit are mutually exclusive interior edge attributes. /// InteriorSlit = 16384, /// /// ON_ComponentAttributes::EdgeAttributes::Mask can be used to isolate EdgeAttributes bits /// from an unsigned int bit field containing other information. /// /// /// Determine if two unsigned ints have identical ON_ComponentAttributes::EdgeAttributes settings. /// /// unsigned int combined_flags1 = ...; /// unsigned int combined_flags2 = ...; /// unsigned int edge_flags1 = (ON_ComponentAttributes::EdgeAttributes::Mask & combined_flags1); /// unsigned int edge_flags2 = (ON_ComponentAttributes::EdgeAttributes::Mask & combined_flags2); /// if ( edge_flags1 == edge_flags1) /// { /// ... edges flags are identical ... /// } /// /// Mask = 0xFFFF }; #pragma endregion /// /// Inspects edge attributes to determine if the edge is has the attributes /// specified by the edge_attributes_filter. /// static bool EdgeIsEligible( unsigned int edge_attributes_filter, const class ON_SubDEdge* edge ); static bool EdgeIsEligible( unsigned int edge_attributes_filter, unsigned int edge_attributes ); /// /// Inspects aggregate edge demographics to determine if every edge has exactly two faces and all /// the faces have a compatible orientations. /// /// /// This sample shows how to determine if an ON_SubD is a solid. /// /// ON_SubD subd = ...; /// if (ON_ComponentAttributes::IsSolid(subd.AggregateEdgeComponentAttributes()) /// { /// // subd is a solid /// ... /// } /// /// /// /// Value made by bitwise or of ON_ComponentAttributes::EdgeAttributes values for every edge in the object. /// /// True if every edge has exactly two faces. /// /// /// /// /// /// /// /// /// /// static bool IsSolid( unsigned int aggregate_edge_component_attributes ); /// /// Inspects aggregate edge demographics to determine if there is a boundary edge. /// /// /// Value made by bitwise or of ON_ComponentAttributes::EdgeAttributes values for every edge in the object. /// /// True if there is at least one edge that has exactly one face. /// Otherwise, false is returned. /// static bool HasBoundary( unsigned int aggregate_edge_component_attributes ); /// /// Inspects aggregate edge demographics to determine if the faces have a compatible orientations. /// /// /// Value made by bitwise or of ON_ComponentAttributes::EdgeAttributes values for every edge in the object. /// /// If for every edge edge with exactly two faces, those two faces have compatible orientations, then true is returned. /// Otherwise, false is returned. /// static bool IsOriented( unsigned int aggregate_edge_component_attributes ); /// /// Inspects aggregate edge demographics to determine if the faces have a compatible orientations. /// /// /// Value made by bitwise or of ON_ComponentAttributes::EdgeAttributes values for every edge in the object. /// /// If there is an edge edge with exactly two faces and those faces have incompatible orientations, /// then true is returned. Otherwise, false is returned. /// static bool IsNotOriented( unsigned int aggregate_edge_component_attributes ); /// /// Inspects aggregate edge demographics to determine if the object is a manifold, possibly with boundary. /// Face orientation is ignored. /// /// /// Value made by bitwise or of ON_ComponentAttributes::EdgeAttributes values for every edge in the object. /// /// If every edge has one or two faces, then true is returned. /// If bAllowBoundaryEdges is true and every edge has one or two faces, then true is returned. /// Otherwise, false is returned. /// static bool IsManifold( unsigned int aggregate_edge_component_attributes ); /// /// Inspects aggregate edge demographics to determine if the object is a not manifold. /// /// /// Value made by bitwise or of ON_ComponentAttributes::EdgeAttributes values for every edge in the object. /// /// True if there is at least one edge with 3 or more faces or at least one wire edge. static bool IsNotManifold( unsigned int aggregate_edge_component_attributes ); }; #endif