Rhino C++ API  8.14
Public Types | Static Public Member Functions | List of all members
CRhinoLayerState Class Reference

#include <rhinoSdkLayer.h>

Public Types

enum  LayerProperty : unsigned int {
  LayerProperty::None = 0x0, LayerProperty::Current = 0x1, LayerProperty::Visible = 0x2, LayerProperty::Locked = 0x4,
  LayerProperty::Color = 0x8, LayerProperty::Linetype = 0x10, LayerProperty::PrintColor = 0x20, LayerProperty::PrintWidth = 0x40,
  LayerProperty::ViewportVisible = 0x80, LayerProperty::ViewportColor = 0x100, LayerProperty::ViewportPrintColor = 0x200, LayerProperty::ViewportPrintWidth = 0x400,
  LayerProperty::RenderMaterial = 0x800, LayerProperty::Unused = 0x1000, LayerProperty::All = 0xFFFFFFFF
}
 

Static Public Member Functions

static int Count (CRhinoDoc &doc)
 
static bool Delete (CRhinoDoc &doc, const wchar_t *state_name)
 
static int Find (CRhinoDoc &doc, const wchar_t *state_name)
 
static int Import (CRhinoDoc &doc, const wchar_t *filename)
 
static bool Names (CRhinoDoc &doc, ON_ClassArray< ON_wString > &state_names)
 
static bool Rename (CRhinoDoc &doc, const wchar_t *state_name, const wchar_t *new_name)
 
static bool Restore (CRhinoDoc &doc, const wchar_t *state_name, CRhinoLayerState::LayerProperty properties, const ON_UUID &viewport_id)
 
static int Save (CRhinoDoc &doc, const wchar_t *state_name, const ON_UUID &viewport_id)
 

Detailed Description

Description: Provides access to the document's saved layer states.

Member Enumeration Documentation

◆ LayerProperty

enum CRhinoLayerState::LayerProperty : unsigned int
strong
Enumerator
None 
Current 
Visible 
Locked 
Color 
Linetype 
PrintColor 
PrintWidth 
ViewportVisible 
ViewportColor 
ViewportPrintColor 
ViewportPrintWidth 
RenderMaterial 
Unused 
All 

Member Function Documentation

◆ Count()

static int CRhinoLayerState::Count ( CRhinoDoc doc)
static

Description: Returns the number of layer states saved in the document. Parameters: doc - [in] The document. Returns: The number of layer states.

◆ Delete()

static bool CRhinoLayerState::Delete ( CRhinoDoc doc,
const wchar_t *  state_name 
)
static

Description: Deletes a layer state saved in the document. Parameters: doc - [in] The document. state_name - [in] The name of the layer state to delete. Returns: true if successful, false otherwise.

◆ Find()

static int CRhinoLayerState::Find ( CRhinoDoc doc,
const wchar_t *  state_name 
)
static

Description: Finds a layer state saved in the document. Parameters: doc - [in] The document. state_name - [in] The name of the layer state to find. Returns: The index of the layer state, -1 on failure.

◆ Import()

static int CRhinoLayerState::Import ( CRhinoDoc doc,
const wchar_t *  filename 
)
static

Description: Imports layer states from another .3dm file. Parameters: doc - [in] The document. filename - [in] The name of the .3dm file. Returns: The number of layer states imported from the file, -1 on failure.

◆ Names()

static bool CRhinoLayerState::Names ( CRhinoDoc doc,
ON_ClassArray< ON_wString > &  state_names 
)
static

Description: Gets the names of the layer states saved in the document. Parameters: doc - [in] The document. state_names - [out] The names of the layer states. Returns: true if successful, false otherwise.

◆ Rename()

static bool CRhinoLayerState::Rename ( CRhinoDoc doc,
const wchar_t *  state_name,
const wchar_t *  new_name 
)
static

Description: Renames a layer state saved in the document. Parameters: doc - [in] The document. state_name - [in] The name of the layer state to rename. new_name - [in] The new name. Returns: true if successful, false otherwise.

◆ Restore()

static bool CRhinoLayerState::Restore ( CRhinoDoc doc,
const wchar_t *  state_name,
CRhinoLayerState::LayerProperty  properties,
const ON_UUID viewport_id 
)
static

Description: Restores a layer state saved in the document. Parameters: doc - [in] The document. state_name - [in] The name of the layer state to restore. properties - [in] The layer properties to restore. viewport_id - [in] If restoring the layer state to a layout or a details, then the id of the layout or detail view's viewport. Otherwise, just use ON_nil_uuid; Returns: true if successful, false otherwise.

◆ Save()

static int CRhinoLayerState::Save ( CRhinoDoc doc,
const wchar_t *  state_name,
const ON_UUID viewport_id 
)
static

Description: Saves a new layer state to the document. Parameters: doc - [in] The document. state_name - [in] The name of the layer state to save. viewport_id - [in] If saving the layer state of a layout or a details, then the id of the layout or detail view's viewport. Otherwise, just use ON_nil_uuid; Returns: The index of the layer state, -1 on failure.