SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
smtk::markup::Resource Class Reference

A resource for annotating geometric models. More...

#include <Resource.h>

Inheritance diagram for smtk::markup::Resource:
[legend]
Collaboration diagram for smtk::markup::Resource:
[legend]

Public Member Functions

 smtkTypeMacro (smtk::markup::Resource)
 
 smtkCreateMacro (smtk::resource::PersistentObject)
 
 smtkSuperclassMacro (smtk::resource::DerivedFrom< Resource, GraphResource >)
 
 Resource (const Resource &)=delete
 
bool setLocation (const std::string &location) override
 Override methods that revise the location of the resource so we can reset resource-relative URLs.
 
std::shared_ptr< smtk::resource::Resourceclone (smtk::resource::CopyOptions &options) const override
 Override clone() to create a new markup resource using this resource as a template.
 
bool copyInitialize (const std::shared_ptr< const smtk::resource::Resource > &source, smtk::resource::CopyOptions &options) override
 Override copyInitialize() to copy domain information.
 
template<typename componentT , typename... Args>
smtk::shared_ptr< componentT > createNode (Args &&... args)
 
std::function< bool(const smtk::resource::Component &)> queryOperation (const std::string &query) const override
 Return a boolean functor that classifies components according to query.
 
DomainMapdomains ()
 Return the resource's catalog of domains.
 
const DomainMapdomains () const
 
std::string lengthUnit () const
 Set/get the default units of length for geometric data in this resource. More...
 
bool setLengthUnit (const std::string &unit)
 
- Public Member Functions inherited from smtk::resource::DerivedFrom< smtk::markup::Resource, GraphResource >
bool isOfType (const Resource::Index &index) const override
 given a resource index, return whether or not this resource is or is derived from the resource described by the index.
 
bool isOfType (const std::string &typeName) const override
 given a resource's unique name, return whether or not this resource is or is derived from the resource described by the name.
 
int numberOfGenerationsFromBase (const std::string &typeName) const override
 
 DerivedFrom (const DerivedFrom &)=delete
 

Static Public Member Functions

static DomainFactorydomainFactory ()
 Return the factory used to construct markup domains. More...
 

Protected Member Functions

 Resource (const smtk::common::UUID &, smtk::resource::Manager::Ptr manager=nullptr)
 
 Resource (smtk::resource::Manager::Ptr manager=nullptr)
 
void initialize ()
 
template<typename Modifier >
bool modifyComponent (Component &component, const Modifier &modifier)
 
- Protected Member Functions inherited from smtk::resource::DerivedFrom< smtk::markup::Resource, GraphResource >
 DerivedFrom (T &&... all)
 Forward all constructor arguments to the parent class.
 
 DerivedFrom (DerivedFrom &&rhs) noexcept=default
 

Protected Attributes

DomainMap m_domains
 
std::string m_lengthUnit
 

Static Protected Attributes

static DomainFactory s_domainFactory
 

Friends

class Component
 

Additional Inherited Members

- Public Types inherited from smtk::resource::DerivedFrom< smtk::markup::Resource, GraphResource >
using ParentResource = GraphResource
 
using Superclass = GraphResource
 
using DirectSuperclass = DerivedFrom< smtk::markup::Resource, GraphResource >
 
- Static Public Attributes inherited from smtk::resource::DerivedFrom< smtk::markup::Resource, GraphResource >
static const Resource::Index type_index
 A static index for this resource type. More...
 

Detailed Description

A resource for annotating geometric models.

The key concept this resource embodies is a set-theoretic approach to referencing geometry. The resource itself owns a catalog of domains, each of which provides a way to enumerate its members and reference sets members (and in some cases, the geometric boundaries of those members).

There are two types of domains: discrete and parametric. Discrete domains have members represented by integer identifiers which live in an "ID space". Parametric domains have members represented by continuous ranges which live in a "parameter space".

Member Function Documentation

◆ domainFactory()

static DomainFactory& smtk::markup::Resource::domainFactory ( )
inlinestatic

Return the factory used to construct markup domains.

This factory is used to deserialize components from json objects.

◆ lengthUnit()

std::string smtk::markup::Resource::lengthUnit ( ) const
inline

Set/get the default units of length for geometric data in this resource.

When the default is empty (which it is by default), no units are provided. Otherwise, all geometric data is assumed to be in these units.

You should not modify the length unit while geometric data exists inside the resource.

If there is no valid unit system or if unit is invalid (i.e., not a valid unit or with dimensions other than length), setLengthUnit() will fail.


The documentation for this class was generated from the following files: