Rhino C++ API  8.14
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
CRhinoDoc Class Referencefinal

#include <rhinoSdkDoc.h>

Public Types

enum  display_engine_id { display_engine_none = 0, display_engine_opengl = 1, display_engine_direct3d = 2, display_engine_count }
 Attributes. More...
 

Public Member Functions

 CRhinoDoc (class CRhDoc &doc)
 
double AbsoluteTolerance () const
 
bool ActivateCommandWindowCaret ()
 
const CRhinoCommandActiveCommand () const
 
const CRhinoCommandContext::COMMAND_STYLE ActiveCommandStyle () const
 
bool ActiveConstructionPlane (ON_Plane &plane)
 
unsigned int ActiveRhinoViewSerialNumber () const
 
ON::active_space ActiveSpace () const
 
const ON_UnitSystem ActiveSpaceUnits () const
 
CRhinoViewActiveView () const
 ON_RUNTIME_APPLE. More...
 
CRhinoBrepObjectAddBrepObject (const ON_Brep &brep, const ON_3dmObjectAttributes *pAttributes=NULL, CRhinoHistory *pHistory=NULL, BOOL32 bReference=0)
 
CRhinoCurveObjectAddCurveObject (const ON_Arc &arc, const ON_3dmObjectAttributes *pAttributes=NULL, CRhinoHistory *pHistory=NULL, BOOL32 bReference=0)
 
CRhinoCurveObjectAddCurveObject (const ON_BezierCurve &bezier_curve, const ON_3dmObjectAttributes *pAttributes=NULL, CRhinoHistory *pHistory=NULL, BOOL32 bReference=0)
 
CRhinoCurveObjectAddCurveObject (const ON_Circle &circle, const ON_3dmObjectAttributes *pAttributes=NULL, CRhinoHistory *pHistory=NULL, BOOL32 bReference=0)
 
CRhinoCurveObjectAddCurveObject (const ON_Curve &curve, const ON_3dmObjectAttributes *pAttributes=NULL, CRhinoHistory *pHistory=NULL, BOOL32 bReference=0)
 
CRhinoCurveObjectAddCurveObject (const ON_Line &line, const ON_3dmObjectAttributes *pAttributes=NULL, CRhinoHistory *pHistory=NULL, BOOL32 bReference=0)
 
CRhinoCurveObjectAddCurveObject (const ON_Polyline &polyline, const ON_3dmObjectAttributes *pAttributes=NULL, CRhinoHistory *pHistory=NULL, BOOL32 bReference=0)
 
unsigned int AddCustomUndoEvent (CRhinoUndoEventHandler *undo_event_handler)
 
const class CRhinoDimAngularAddDimAngularObject (ON_Arc arc, double offset, const ON_DimStyle *dim_style=nullptr, const ON_3dmObjectAttributes *attributes=nullptr)
 
const class CRhinoDimAngularAddDimAngularObject (ON_Line line1, ON_3dPoint point_on_line1, ON_Line line2, ON_3dPoint point_on_line2, ON_3dPoint point_on_angular_dimension_arc, bool bSetExtensionPoints, const ON_DimStyle *dim_style=nullptr, const ON_3dmObjectAttributes *attributes=nullptr)
 
const class CRhinoDimLinearAddDimLinearObject (ON_3dPoint extension_point0, ON_3dPoint extension_point1, ON_3dPoint dimension_line_point, ON_3dVector plane_normal, const ON_DimStyle *dim_style=nullptr, const ON_3dmObjectAttributes *attributes=nullptr)
 
const class CRhinoDimLinearAddDimLinearObject (ON_3dPoint extension_point0, ON_3dPoint extension_point1, ON_Line dimension_line, ON_3dVector plane_normal, const ON_DimStyle *dim_style=nullptr, const ON_3dmObjectAttributes *attributes=nullptr)
 
CRhinoExtrusionObjectAddExtrusionObject (const ON_Extrusion &extrusion, const ON_3dmObjectAttributes *pAttributes=NULL, CRhinoHistory *pHistory=NULL, bool bReference=0)
 
void AddGrip (CRhinoGripObject &grip)
 
const class CRhinoLeaderAddLeaderObject (const wchar_t *leader_text, const ON_Plane &plane, int leader_polyline_point_count, const ON_3dPoint *leader_polyline_points, const ON_DimStyle *dim_style=nullptr, const ON_3dmObjectAttributes *attributes=nullptr)
 
CRhinoMeshObjectAddMeshObject (const ON_Mesh &mesh, bool bRequireValidMesh, const ON_3dmObjectAttributes *pAttributes=NULL, CRhinoHistory *pHistory=NULL, BOOL32 bReference=0)
 
CRhinoMeshObjectAddMeshObject (const ON_Mesh &mesh, const ON_3dmObjectAttributes *pAttributes=NULL, CRhinoHistory *pHistory=NULL, BOOL32 bReference=0)
 
void AddMruCommand (const wchar_t *cmd, const wchar_t *display_string, const wchar_t *shortcut, const UINT modifier_flags)
 
void AddMruCommand (const wchar_t *cmd, const wchar_t *display_string=NULL)
 
bool AddObject (CRhinoObject *object, bool bReferenceObject=false, bool bInstanceDefinition=false)
 
CRhinoPointCloudObjectAddPointCloudObject (int point_count, const ON_3dPoint *point_list, const ON_3dmObjectAttributes *pAttributes=NULL, CRhinoHistory *pHistory=NULL, BOOL32 bReference=0)
 
CRhinoPointObjectAddPointObject (const ON_3dPoint &point, const ON_3dmObjectAttributes *pAttributes=NULL, CRhinoHistory *pHistory=NULL, BOOL32 bReference=0)
 
CRhinoSurfaceObjectAddSurfaceObject (const ON_Surface &surface, const ON_3dmObjectAttributes *pAttributes=NULL, CRhinoHistory *pHistory=NULL, BOOL32 bReference=0)
 
const class CRhinoTextAddTextObject (const wchar_t *text, const ON_Plane &plane, const ON_3dPoint text_location, const ON_DimStyle *dim_style=nullptr, const ON_3dmObjectAttributes *attributes=nullptr)
 
double AngleToleranceDegrees () const
 
double AngleToleranceRadians () const
 
void AppendPageView (class CRhinoPageView &pageView)
 
int ArrangeViews (bool bMakeVisible) const
 
bool Audit (ON_TextLog *text_log, bool bAttemptRepair)
 
BOOL32 AutoDelete (void) const
 
unsigned int AutomaticallySetActiveRhinoViewSerialNumber (unsigned int ineligible_rhino_view_sn)
 
bool BeginUndoRecord (const CRhinoCommand *)
 
bool BeginUndoRecord (const wchar_t *sActionDescription)
 
unsigned int BeginUndoRecordEx (const CRhinoCommand *)
 
unsigned int BeginUndoRecordEx (const wchar_t *sActionDescription)
 
void BeginWaitCursor ()
 
const ON_BoundingBoxBoundingBox (bool bTight, bool bIncludeCustomRenderMeshes, bool bIncludeCurves) const
 
class CRhCameraIcon * CameraIcon (CRhinoView *view=0) const
 
void ChangeTitleToUnNamed ()
 
void ClearMarks (CRhinoObjectIterator &, int=0)
 
void ClearPathName (void)
 
void ClearReadFileResult ()
 
void ClearRedoRecords ()
 
void ClearUndoRecords (bool=false)
 
void ClearUndoRecords (unsigned int undo_record_sn, bool bPurgeDeletedObjects)
 
unsigned int CloseAllOtherDocuments () const
 
bool CloseRhinoView (CRhinoView *pView)
 
const CRhinoApp::CRhMruCommandRecordCommandToRepeat () const
 
const ON_wString ComponentNameFromCandidateName (ON_ModelComponent::Type component_type, bool bMakeUniqueAndValid, const wchar_t *candidate_name) const
 
int ConstructionPlaneCount () const
 
const class IRhRdkContentsContents () const
 
int CreateDefaultDimstyles (ON_ClassArray< ON_DimStyle > &dimstyles)
 
class CRhinoDimAngularCreateDimAngularObject (const ON_DimAngular &dim_angular, const ON_3dmObjectAttributes *attributes=nullptr) const
 
class CRhinoDimLinearCreateDimLinearObject (const ON_DimLinear &dim_linear, const ON_3dmObjectAttributes *attributes=nullptr) const
 
class CRhinoLeaderCreateLeaderObject (const ON_Leader &leader, const ON_3dmObjectAttributes *attributes=nullptr) const
 
class CRhinoLeaderCreateLeaderObject (const wchar_t *leader_text, const ON_Plane &plane, int leader_polyline_point_count, const ON_3dPoint *leader_polyline_points, const ON_DimStyle *dim_style=nullptr, const ON_3dmObjectAttributes *attributes=nullptr) const
 
unsigned int CreateRhinoPageView (const wchar_t *title=nullptr)
 
unsigned int CreateRhinoView (const ON_3dmView *view, bool bShowView)
 
unsigned int CreateRhinoView (const ON_3dmView *view, CRuntimeClass *pMfcViewRuntimeClass, bool bShowView)
 
class CRhinoTextCreateTextObject (const ON_Text &text, const ON_3dmObjectAttributes *attributes=nullptr) const
 
class CRhinoTextCreateTextObject (const wchar_t *text, const ON_Plane &plane, const ON_3dPoint text_location, const ON_DimStyle *dim_style=nullptr, const ON_3dmObjectAttributes *attributes=nullptr) const
 
void CreateViewLayout (int view_count, const ON_3dmView *views)
 
int CullUndoRecords ()
 
int CullUndoRecords (int min_step_count, size_t max_memory_size_bytes)
 
const class IRhRdkCurrentEnvironmentCurrentEnvironment () const
 
CRhUndoRecord * CurrentUndoRecord () const
 
unsigned int CurrentUndoRecordSerialNumber () const
 
const ON_3dmObjectAttributes DefaultObjectAttributes () const
 
void DefaultViewLayout ()
 
void DefaultViewLayout (ON_BoundingBox model_bbox)
 
void DeferredRedraw (void)
 
bool DeleteObject (const CRhinoObjRef &objref, bool bQuiet=true, bool bIgnoreModes=false)
 
const CRhinoDimStyleContext DimStyleContext () const
 
int DisplayEngineStatus (int engine_id) const
 
const class IRhRdkDitheringDithering () const
 
enum CRhinoDocStatus DocStatus () const
 
unsigned int DocumentMissingFontTest (bool bInteractive, unsigned int begin_dimstyle_search_at_sn, unsigned int begin_object_search_at_sn)
 
BOOL32 DoFileSave ()
 
BOOL32 DoSave (LPCTSTR lpszPathName, BOOL32 bReplace=TRUE)
 
void EnableCameraIcon (CRhinoView *view)
 
CRhinoGetEnableGet (CRhinoGet *)
 
void EnableUndoRecording (bool=true)
 
void EnableValidateNewObjects (bool bEnable)
 
bool EndUndoRecord ()
 <- OBSOLETE More...
 
bool EndUndoRecord (unsigned int undo_record_sn)
 
bool EndUndoRecord (unsigned int undo_record_sn0, unsigned int undo_record_sn1)
 
void EndWaitCursor ()
 
void EnterCommand (const CRhinoCommand *cmd, unsigned int *undo_record_sn)
 
class CRhEventManager * EventManager (void) const
 ON_RUNTIME_APPLE. More...
 
CRhinoCommand::result ExecuteCommand (const wchar_t *cmd_name)
 
void ExitCommand (unsigned int rhino_doc_sn0, unsigned int rhino_doc_sn1, const CRhinoCommand *cmd, unsigned int undo_record_sn)
 
const class CRhRdkContentFindContentInstance (const ON_UUID &instanceId) const
 
bool FindView (const wchar_t *title, ON_3dmView &view, bool include_standard_views=true, bool include_page_views=true)
 
bool FindView (const wchar_t *title, ON_3dmView &view, CRhinoView::ViewTypeFilter view_types)
 
bool FindView (const wchar_t *title, ON_3dmView &view, CRhinoView::ViewTypeFilter view_types) const
 
void FlashObjectList (ON_SimpleArray< const CRhinoObject * > &obj_list, int flash_style=1)
 
void FourViewLayout (bool bUseMatchingViews=false)
 
void FourViewLayout (ON_BoundingBox model_bbox, bool bThirdAngleProjection, bool bUseMatchingViews)
 
void FourViewLayout (ON_BoundingBox model_bbox, bool bUseMatchingViews=false)
 
void Get3dmAnnotationContext (class ON_3dmAnnotationContext &annotation_context) const
 
void Get3dmSettings (class ON_3dmSettings &settings) const
 
void GetDefaultObjectAttributes (ON_3dmObjectAttributes &) const
 attributes to use for new object More...
 
CDocTemplate * GetDocTemplate () const
 
virtual void GetEmbeddedFilesList (TextureReportFilter filter, ON_ClassArray< ON_wString > &sFiles) const
 
POSITION GetFirstViewPosition () const
 
int GetMRUCommands (ON_ClassArray< ON_wString > &display_strings, ON_ClassArray< ON_wString > &macros) const
 
CView * GetNextView (POSITION &rPosition) const
 
int GetPageViewNumber (const class CRhinoPageView &pageView) const
 
ON_wString GetPathName () const
 CRhinoDimstyleTable* DimstyleTable();. More...
 
int GetRedoRecords (ON_SimpleArray< class CRhUndoRecord * > &) const
 
ON_wString GetTitle (void) const
 
int GetUndoRecords (ON_SimpleArray< class CRhUndoRecord * > &) const
 
bool GetUserString (const wchar_t *key, ON_wString &string_value) const
 
int GetUserStringKeys (ON_ClassArray< ON_wString > &user_string_keys) const
 
int GetUserStrings (ON_ClassArray< ON_UserString > &user_strings) const
 
int GetViewList (ON_SimpleArray< CRhinoView * > &view_list, bool include_standard_views=true, bool include_page_views=true)
 
int GetViewList (ON_SimpleArray< CRhinoView * > &view_list, CRhinoView::ViewTypeFilter filter) const
 
bool GetWriteFileOptonsAndWrite (CRhinoFileWriteOptions fwo_in)
 
bool GetWriteFileOptonsAndWrite (CRhinoFileWriteOptions fwo_in, CRhinoFileWriteOptions &fwo_out)
 
const class IRhRdkGroundPlaneGroundPlane () const
 
bool HasUndoRecords () const
 
bool HideObject (const CRhinoObjRef &objref, bool bIgnoreLayerMode=false)
 hides object in document More...
 
bool ImportPlugInFileReadInProgress () const
 
int InCommand (bool bIgnoreScriptRunnerCommands=false) const
 
CRhinoGetInGet () const
 
CRhinoGetColorInGetColor () const
 Returns non-null if currently in a CRhinoGetString::GetString();. More...
 
CRhinoGetMeshesInGetMeshes () const
 Returns non-null if currently in a CRhinoGetString::GetString();. More...
 
CRhinoGetNumberInGetNumber () const
 Returns non-null if currently in a CRhinoGetString::GetString();. More...
 
CRhinoGetObjectInGetObject () const
 Returns non-null if currently in a CRhinoGetPoint::GetObject();. More...
 
CRhinoGetOptionInGetOption () const
 Returns non-null if currently in a CRhinoGetString::GetString();. More...
 
CRhinoGetPointInGetPoint () const
 Returns non-null if currently in a CRhinoGetPoint::GetPoint();. More...
 
CRhinoGetStringInGetString () const
 Returns non-null if currently in a CRhinoGetString::GetString();. More...
 
bool InScriptRunnerCommand () const
 
void InvalidateBoundingBox () const
 
unsigned int InvalidObjectCount () const
 
bool IsAvailable () const
 
bool IsClosing () const
 
bool IsCreating () const
 
bool IsDocumentLocked () const
 
bool IsDocumentReadOnly () const
 
bool IsHeadless () const
 
bool IsInitializing () const
 
BOOL32 IsModified (void) const
 
bool IsOpening () const
 
const class IRhRdkLinearWorkflowLinearWorkflow () const
 
bool LockObject (const CRhinoObjRef &objref, bool bIgnoreLayerMode=false)
 locks object in document More...
 
const ON_ObjectLookupDocumentObject (ON_UUID id, bool bIgnoreDeleted) const
 
int LookupObject (const CRhinoGroup &, ON_SimpleArray< CRhinoObject * > &) const
 
int LookupObject (const CRhinoLayer &, ON_SimpleArray< const CRhinoObject * > &) const
 
int LookupObject (const CRhinoLayer &, ON_SimpleArray< CRhinoObject * > &) const
 
int LookupObject (const CRhinoLinetype &, ON_SimpleArray< CRhinoObject * > &) const
 
int LookupObject (const CRhinoMaterial &, ON_SimpleArray< CRhinoObject * > &) const
 
const CRhinoObjectLookupObject (ON_UUID object_uuid) const
 use CRhinoObjectIterator to iterate through CRhinoObject list(s) More...
 
const CRhinoObjectLookupObjectByRuntimeSerialNumber (unsigned int runtime_serial_number) const
 
const CRhinoObjectLookupObjectByRuntimeSerialNumber (unsigned int runtime_serial_number, CRhinoObjectIterator &it) const
 
const ON_ComponentManifestManifest () const
 
bool ModelComponentCheck (const ON_ModelComponent *model_component, int table_index, ON_wString *error_description) const
 
const wchar_t * ModelName () const
 
const ON_UnitSystemModelUnits () const
 
bool ModifyObjectAttributes (const CRhinoObjRef &objref, const CRhinoObjectAttributes &new_attributes, BOOL32 bQuiet=false)
 
AFX_MODULE_STATE * ModuleState (void) const
 
CRhinoObjectMorphObject (const CRhinoObject *old_object, const ON_SpaceMorph &morph, bool bAddNewObjectToDoc, bool bDeleteOriginal)
 
const ON_ClassArray< CRhinoApp::CRhMruCommandRecord > & MruCommandList () const
 
const wchar_t * MruMenuString () const
 MRU Commands for this document. More...
 
unsigned int NewView (const ON_3dmView &new_view)
 
unsigned int NewView (const ON_3dmView &new_view, bool bShowView)
 
bool NextConstructionPlane (ON_Plane &plane)
 
unsigned int NextUndoRecordSerialNumber () const
 
bool ObjectFinderIsValid (ON_TextLog *text_log, unsigned int max_error_count, size_t *sn_count, size_t *id_count) const
 
void OnCloseDocument ()
 
BOOL32 OnNewDocument ()
 
BOOL32 OnOpenDocument (LPCTSTR lpszPathName)
 
BOOL32 OnSaveDocument (LPCTSTR lpszPathName)
 
const ON_UnitSystemPageUnits () const
 
void PageViewDetailIsActive (BOOL32 isActive)
 
int PickObjects (const CRhinoPickContext &, CRhinoObjRefArray &) const
 PickObjects() returns number of objects added to array. More...
 
int PickObjects (const CRhinoPickContext &, CRhinoObjRefArray &, bool bSilent) const
 PickObjects() returns number of objects added to array. More...
 
class CRhDocSerializeStatus * PopSerializeStatus ()
 
const class IRhRdkPostEffectsPostEffects () const
 
bool PrevConstructionPlane (ON_Plane &plane)
 
CRhinoDocPropertiesProperties ()
 
const CRhinoDocPropertiesProperties () const
 
int PurgeAnonymousUserTable (bool bQuiet)
 
unsigned int PurgeCyclicInstanceReferences ()
 
unsigned int PurgeLinkedIDefModel (unsigned int linked_idef_model_sn)
 
bool PurgeObject (CRhinoObject *&object)
 
unsigned int PurgeWorkSessionReferenceModel (unsigned int worksession_ref_model_sn)
 
void PushConstructionPlane (const ON_Plane &plane)
 
void PushSerializeStatus (class CRhDocSerializeStatus *)
 
const class CRhRdkDocumentRdkDocument () const
 
ON::ReadFileResult Read3DM (ON_BinaryArchive &archive, class CRhFileReadOptions &fro3dm)
 
const class CRhFileReadOptions * ReadFileOptions () const
 
ON::ReadFileResult ReadFileResult () const
 
int ReadFileVersion () const
 
bool ReadingAncillaryModel (unsigned int *worksession_ref_model_sn, const CRhinoInstanceDefinition **idef, ON_UUID *grandparent_layer_id) const
 
bool ReadPlugInFile (class CRhinoFileImportPlugIn *import_plug_in, int file_extension_index, class CRhFileReadOptions &fro)
 
bool Redo ()
 
bool RedoActive () const
 
void Redraw ()
 
void Redraw (unsigned int display_hint)
 
void RedrawViewHelper (CRhinoView *view, int view_redraw_display_hint)
 
void Regen ()
 
void RemoveGrip (CRhinoGripObject &grip)
 
void RemovePageView (class CRhinoPageView &pageView)
 
const class IRhRdkRenderChannelsRenderChannels () const
 
void RepeatCommand ()
 repeats previous command More...
 
void ReplaceModelViews (int view_count, const ON_3dmView *views)
 
const CRhinoBrepObjectReplaceObject (const CRhinoObjRef &objref, const ON_Brep &brep)
 
const CRhinoCurveObjectReplaceObject (const CRhinoObjRef &objref, const ON_Curve &curve)
 
const CRhinoExtrusionObjectReplaceObject (const CRhinoObjRef &objref, const ON_Extrusion &extrusion)
 
const CRhinoObjectReplaceObject (const CRhinoObjRef &objref, const ON_Geometry &geometry, bool bIgnoreModes)
 
const CRhinoMeshObjectReplaceObject (const CRhinoObjRef &objref, const ON_Mesh &mesh)
 
const CRhinoSubDObjectReplaceObject (const CRhinoObjRef &objref, const ON_SubD &subd)
 
const CRhinoSurfaceObjectReplaceObject (const CRhinoObjRef &objref, const ON_Surface &surface)
 
bool ReplaceObject (const CRhinoObjRef &objref, CRhinoObject *new_object, bool bIgnoreModes, bool bSkipInCommandTest)
 
bool ReplaceObject (const CRhinoObjRef &objref, CRhinoObject *new_object, bool bIgnoreModes=false)
 
const CRhinoPointObjectReplaceObject (const CRhinoObjRef &objref, ON_3dPoint point)
 
const CRhinoSubDObjectReplaceObject (const CRhinoObjRef &objref, ON_SubDRef subd_ref)
 
void ResetViewPipelines (void)
 
void RestoreWaitCursor ()
 call after MessageBox More...
 
bool RhinoFileReadInProgress () const
 
bool RunMenuScript (const wchar_t *s)
 
void RunMruCommand (int cmd_index)
 
void RunMruFavoriteCommand (int cmd_index)
 
const CRhinoCommandRunningCommand (int i) const
 
const ON_SimpleArray< const CRhinoCommand * > & RunningCommandsStack ()
 
bool RunScript (const class CRhinoScriptContext &script)
 
bool RunScript (const wchar_t *script, int echo_mode=1)
 
bool RunScriptEx (const wchar_t *script, const wchar_t *mruDisplayString, int echo_mode=1)
 
unsigned int RuntimeSerialNumber () const
 
const class IRhRdkSafeFrameSafeFrame () const
 
CDocument * SafeMFCDoc (void)
 
const CDocument * SafeMFCDoc (void) const
 
bool SaveDocument (bool bUseBatchMode)
 
bool SaveModified (bool bUseBatchMode)
 
BOOL32 SaveModified (void)
 
int ScaleObjects (CRhinoObjectIterator &it, double scale, bool bDeleteOriginal, bool bAddTransformHistory, bool bTransformReferenceObjects)
 
class CRhDocSerializeStatus * SerializeStatus () const
 
bool SetActiveRhinoViewSerialNumber (unsigned int new_active_rhino_view_sn)
 
void SetAutoDelete (BOOL32 bAutoDelete)
 
void SetCommandToRepeat (const CRhinoApp::CRhMruCommandRecord &rec)
 
void SetModelName (const char *)
 
void SetModelName (const wchar_t *)
 
void SetModifiedFlag (BOOL32 bModified=TRUE)
 
void SetMruMenuString (LPCTSTR str)
 
void SetPageViewNumber (class CRhinoPageView &pageView, int page)
 
void SetPathName (LPCTSTR, BOOL32 bAddToMRU=TRUE)
 
void SetReadFileResult (ON::ReadFileResult read_file_result)
 
void SetRedrawDisplayHint (unsigned int display_hint, bool bShadedOnly=false) const
 
unsigned int SetSubDAppearance (ON_SubDComponentLocation subd_appearance)
 
void SetTitle (LPCTSTR)
 
bool SetUserString (const wchar_t *key, const wchar_t *string_value)
 
bool ShowObject (const CRhinoObjRef &objref, bool bIgnoreLayerMode=false)
 shows hidden object More...
 
const class IRhRdkSkylightSkylight () const
 
BOOL32 SnapTo (const CRhinoSnapContext &snap_context, CRhinoSnapEvent &snap_event, const ON_SimpleArray< ON_3dPoint > *construction_points=0, const ON_SimpleArray< ON_3dPoint > *snap_points=0, const ON_SimpleArray< ON_3dPoint > *int_snap_points=0) const
 
const ON_SimpleArray< class CRhinoPageView * > & SortedPageViewList ()
 
void StatusBarProgressMeterEnd ()
 
int StatusBarProgressMeterPos (const wchar_t *pszLabel, int nPos, bool bAbsolute)
 
int StatusBarProgressMeterPos (int nPos, bool bAbsolute=true)
 
int StatusBarProgressMeterStart (int nLower, int nUpper, const wchar_t *pszLabel=nullptr, bool bEmbedLabel=true, bool bShowPercent=true)
 
ON_SubDComponentLocation SubDAppearance () const
 
const class IRhRdkSunSun () const
 
const CRhinoDocTableReferenceTable (ON_ModelComponent::Type component_type) const
 
const wchar_t * TemplateFileUsed () const
 
virtual TextureReportResult TextureReport (TextureReportFilter initialFilter, bool bAllowAbort, bool bForceDisplayIfEmpty)
 
void ThreeViewLayout (bool bUseMatchingViews=false)
 
void ThreeViewLayout (ON_BoundingBox model_bbox, bool bUseMatchingViews=false)
 
CRhinoObjectTransformObject (const CRhinoObject *old_object, const ON_Xform &xform, bool bAddNewObjectToDoc, bool bDeleteOriginal, bool bAddTransformHistory)
 
CRhinoObjectTransformObject (const CRhinoObject *old_object, const ON_Xform &xform, bool bAddNewObjectToDoc, bool bDeleteOriginal, bool bAddTransformHistory, bool bTransformReferenceObjects, ON_2dexMap *pGroupMap=0)
 
CRhinoObjectTransformObject (CRhinoObjRef &objref, const ON_Xform &xform, bool bDeleteOriginal=true, bool bIgnoreModes=false, bool bAddTransformHistory=false)
 
int TransformObjects (CRhinoObjectIterator &it, const ON_Xform &xform, bool bDeleteOriginal, bool bIgnoreModes, bool bAddTransformHistory, bool bTransformReferenceObjects)
 As of Sept 14, 2017, This is not used by rhino. More...
 
int TransformObjects (CRhinoObjectIterator &it, const ON_Xform &xform, bool bDeleteOriginal=true, bool bIgnoreModes=false, bool bAddTransformHistory=false)
 As of Sept 14, 2017, This is not used by rhino. More...
 
bool UndeleteObject (const CRhinoObject *object)
 
bool Undo (class CRhUndoRecord *=NULL)
 
bool UndoActive () const
 
int UndoRecordCount () const
 
bool UndoRecordingIsActive () const
 true if actually happening now More...
 
bool UndoRecordingIsEnabled () const
 true if permitted More...
 
size_t UndoRecordMemorySize () const
 
ON::LengthUnitSystem UnitSystem () const
 OBSOLETE - USE ModelUnits or PageUnits. More...
 
bool UnlockObject (const CRhinoObjRef &objref, bool bIgnoreLayerMode=false)
 unlocks locked object More...
 
int UnselectAll (BOOL32 bIgnorePersistentSelections=false)
 
void UpdateAllViews (CView *pSender, LPARAM lHint=0L, CObject *pHint=NULL)
 
class CRhAnonymousUserTable * UserDataTable (void)
 
bool ValidateNewObjects () const
 
const CRhinoViewViewFromViewportId (ON_UUID viewport_id) const
 
void ViewModified (CRhinoView *)
 
bool Write3dmFile (ON_BinaryArchive &binary_archive, CRhinoFileWriteOptions fwo_in)
 
bool Write3dmFile (ON_BinaryArchive &binary_archive, CRhinoFileWriteOptions fwo_in, CRhinoFileWriteOptions &fwo_out)
 
bool WriteFile (CRhinoFileWriteOptions fwo_in)
 
bool WriteFile (CRhinoFileWriteOptions fwo_in, CRhinoFileWriteOptions &fwo_out)
 
const class CRhinoFileWriteOptionsWriteFileInProgress () const
 
bool WriteFilePathAndOptionsDialog (CRhinoFileWriteOptions fwo_in, unsigned int minimum_rhino_3dm_version_rescrition, CRhinoFileWriteOptions &fwo_out, HWND pWndParent=0) const
 

Static Public Member Functions

static unsigned int CloseAllDocuments ()
 
static bool CloseDocument (unsigned int rhino_doc_sn)
 
static unsigned int CreateDocument (const wchar_t *sModelTemplateFileName, const CRhinoCreateDocumentOptions *create_document_options)
 
static const wchar_t * DefaultDimstyleNamePrefix ()
 < SHARED_HANDLERS More...
 
static unsigned int DocumentCount ()
 
static CRhinoDocFromRuntimeSerialNumber (unsigned int doc_runtime_serial_number)
 
static unsigned int GetDocList (ON_SimpleArray< unsigned int > &rhino_doc_sn_list)
 
static unsigned int GetDocList (unsigned int rhino_doc_sn0, size_t rhino_doc_sn_list_capacity, unsigned int *rhino_doc_sn_list)
 
static void GetUntitledDocName (ON_wString &sUntitledDocName)
 
static unsigned int HeadRuntimeSerialNumber ()
 
static bool IsValidDocPointer (const void *rhino_doc)
 
static bool IsValidDocReference (const CRhinoDoc &rhino_doc)
 
static unsigned int ModelessUserInterfaceDocSerialNumber ()
 
static unsigned int NextRuntimeSerialNumber ()
 
static unsigned int OpenDocument (const wchar_t *sModelFileName, const CRhinoOpenDocumentOptions *open_document_options)
 
static void RecreateRhinoViewHWnds ()
 
static void RedrawAllDocs ()
 
static void RedrawAllDocs (unsigned int display_hint)
 
static void RedrawDoc (unsigned int rhino_doc_sn)
 
static unsigned int RuntimeSerialNumber (const CRhinoDoc *rhino_doc)
 
static bool SaveAllModifiedDocuments ()
 
static bool SaveAllModifiedDocuments (bool bUseBatchMode)
 
static unsigned int TailRuntimeSerialNumber ()
 
static unsigned int TargetDocSerialNumber ()
 

Public Attributes

class CRhDocSdkExtension * m__doc_sdk_extension
 
class CRhIDefUpdate * m__idef_update
 runtime information used when updating linked instance definitions More...
 
CRhinoBitmapTable m_bitmap_table
 
CRhinoDimStyleTable m_dimstyle_table
 
CRhinoGroupTable m_group_table
 
CRhinoHatchPatternTable m_hatchpattern_table
 
CRhinoHistoryRecordTable m_history_record_table
 
CRhinoInstanceDefinitionTable m_instance_definition_table
 
CRhinoLayerTable m_layer_table
 
CRhinoLightTable m_light_table
 
CRhinoLinetypeTable m_linetype_table
 
CRhinoMaterialTable m_material_table
 
class CRhSelSetManager * m_selset_manager
 
CRhinoTextureMappingTable m_texture_mapping_table
 

Static Public Attributes

static const unsigned int NullRuntimeSerialNumber
 

Friends

class C_EW_Manager
 
class CRhDoc
 
class CRhinoApp
 
class CRhinoFileMenu
 
class CRhinoInstanceDefinitionTable
 
class CRhinoLayerTable
 
class CRhinoObjectIterator
 
class CRhinoRead3dmHelper
 
class CRhPushPopDocStatus
 
int RhinoMemoryErrorHandler (int)
 SDK classes. More...
 
void RhSetTemplateFileUsed (CRhinoDoc &, const wchar_t *)
 

Member Enumeration Documentation

◆ display_engine_id

Attributes.

Enumerator
display_engine_none 
display_engine_opengl 
display_engine_direct3d 
display_engine_count 

The value of this enum will change if new display engines are added. Do not explicitly set it.

Constructor & Destructor Documentation

◆ CRhinoDoc()

CRhinoDoc::CRhinoDoc ( class CRhDoc doc)

Member Function Documentation

◆ AbsoluteTolerance()

double CRhinoDoc::AbsoluteTolerance ( ) const

Returns: Model space absolute tolerance. Remarks: Use DocProperties().PageUnitsAndTolerances() for page space.

◆ ActivateCommandWindowCaret()

bool CRhinoDoc::ActivateCommandWindowCaret ( )

Description: Activates flashing caret in command prompt.

◆ ActiveCommand()

const CRhinoCommand* CRhinoDoc::ActiveCommand ( ) const

Returns: Pointer to currently running command.

◆ ActiveCommandStyle()

const CRhinoCommandContext::COMMAND_STYLE CRhinoDoc::ActiveCommandStyle ( ) const

Returns: Style of currently running command: interactive_ui, script_ui, or batch_ui

◆ ActiveConstructionPlane()

bool CRhinoDoc::ActiveConstructionPlane ( ON_Plane plane)

◆ ActiveRhinoViewSerialNumber()

unsigned int CRhinoDoc::ActiveRhinoViewSerialNumber ( ) const

Viewport layout Returns: The runtime serial number of the CRhinoView that is this document's current active view. Remarks: Whenever a document needs a single view to perform a calculation it uses the active view. Examples include

  • parsing x,y,z into a world coordinate (cplane to world)
  • saving a thumbnail image in file
  • exporting to a file format that can contain only one viewport
  • modeless user interface that reports view information

◆ ActiveSpace()

ON::active_space CRhinoDoc::ActiveSpace ( ) const

◆ ActiveSpaceUnits()

const ON_UnitSystem CRhinoDoc::ActiveSpaceUnits ( ) const

◆ ActiveView()

CRhinoView* CRhinoDoc::ActiveView ( ) const

ON_RUNTIME_APPLE.

◆ AddBrepObject()

CRhinoBrepObject* CRhinoDoc::AddBrepObject ( const ON_Brep brep,
const ON_3dmObjectAttributes pAttributes = NULL,
CRhinoHistory pHistory = NULL,
BOOL32  bReference = 0 
)

Description: Add a brep object to Rhino. Parameters: brep - [in] A duplicate of this brep is added to Rhino. pAttributes - [in] (optional) attributes. If NULL, the current default attributes are used. bReference - [in] true if the point object is from a reference file. Reference objects do not persist in archives. Remarks: This is an easy to use wrapper that creates a new CRhinoBrepObject and calls CRhinoDoc::AddObject. The input brep is copied and should be deleted by the caller when its no longer needed. See Also: CRhinoDoc::AddPointObject CRhinoDoc::AddPointCloudObject CRhinoDoc::AddCurveObject CRhinoDoc::AddSurfaceObject CRhinoDoc::AddMeshObject CRhinoDoc::AddBrepObject CRhinoDoc::ReplaceObject CRhinoMeshObject::CRhinoMeshObject() CRhinoDoc::AddObject

◆ AddCurveObject() [1/6]

CRhinoCurveObject* CRhinoDoc::AddCurveObject ( const ON_Arc arc,
const ON_3dmObjectAttributes pAttributes = NULL,
CRhinoHistory pHistory = NULL,
BOOL32  bReference = 0 
)

Description: Add an arc object to Rhino. Parameters: arc - [in] pAttributes - [in] (optional) attributes. If NULL, the current default attributes are used. pHistory - [in] (optional) history bReference - [in] true if the point object is from a reference file. Reference objects do not persist in archives. Remarks: This is an easy to use wrapper that creates a new CRhinoCurveObject and calls CRhinoDoc::AddObject. The input arc is copied and should be deleted by the caller when its no longer needed. See Also: CRhinoDoc::AddPointObject CRhinoDoc::AddPointCloudObject CRhinoDoc::AddCurveObject CRhinoDoc::AddSurfaceObject CRhinoDoc::AddMeshObject CRhinoDoc::AddBrepObject CRhinoDoc::ReplaceObject CRhinoCurveObject::CRhinoCurveObject() CRhinoDoc::AddObject

◆ AddCurveObject() [2/6]

CRhinoCurveObject* CRhinoDoc::AddCurveObject ( const ON_BezierCurve bezier_curve,
const ON_3dmObjectAttributes pAttributes = NULL,
CRhinoHistory pHistory = NULL,
BOOL32  bReference = 0 
)

Description: Add a Bezier curve object to Rhino. Parameters: bezier_curve - [in] pAttributes - [in] (optional) attributes. If NULL, the current default attributes are used. bReference - [in] true if the point object is from a reference file. Reference objects do not persist in archives. Remarks: This is an easy to use wrapper that creates a new CRhinoCurveObject and calls CRhinoDoc::AddObject. The input bezier_curve is copied and should be deleted by the caller when its no longer needed. See Also: CRhinoDoc::AddPointObject CRhinoDoc::AddPointCloudObject CRhinoDoc::AddCurveObject CRhinoDoc::AddSurfaceObject CRhinoDoc::AddMeshObject CRhinoDoc::AddBrepObject CRhinoDoc::ReplaceObject CRhinoCurveObject::CRhinoCurveObject() CRhinoDoc::AddObject

◆ AddCurveObject() [3/6]

CRhinoCurveObject* CRhinoDoc::AddCurveObject ( const ON_Circle circle,
const ON_3dmObjectAttributes pAttributes = NULL,
CRhinoHistory pHistory = NULL,
BOOL32  bReference = 0 
)

Description: Add an circle object to Rhino. Parameters: circle - [in] pAttributes - [in] (optional) attributes. If NULL, the current default attributes are used. pHistory - [in] (optional) history bReference - [in] true if the point object is from a reference file. Reference objects do not persist in archives. Remarks: This is an easy to use wrapper that creates a new CRhinoCurveObject and calls CRhinoDoc::AddObject. The input circle is copied and should be deleted by the caller when its no longer needed. See Also: CRhinoDoc::AddPointObject CRhinoDoc::AddPointCloudObject CRhinoDoc::AddCurveObject CRhinoDoc::AddSurfaceObject CRhinoDoc::AddMeshObject CRhinoDoc::AddBrepObject CRhinoDoc::ReplaceObject CRhinoCurveObject::CRhinoCurveObject() CRhinoDoc::AddObject

◆ AddCurveObject() [4/6]

CRhinoCurveObject* CRhinoDoc::AddCurveObject ( const ON_Curve curve,
const ON_3dmObjectAttributes pAttributes = NULL,
CRhinoHistory pHistory = NULL,
BOOL32  bReference = 0 
)

Description: Add a curve object to Rhino. Parameters: curve - [in] A duplicate of this curve is added to Rhino. pAttributes - [in] (optional) attributes. If NULL, the current default attributes are used. bReference - [in] true if the point object is from a reference file. Reference objects do not persist in archives. Remarks: This is an easy to use wrapper that creates a new CRhinoCurveObject and calls CRhinoDoc::AddObject. The input curve is copied and should be deleted by the caller when its no longer needed. See Also: CRhinoDoc::AddPointObject CRhinoDoc::AddPointCloudObject CRhinoDoc::AddCurveObject CRhinoDoc::AddSurfaceObject CRhinoDoc::AddMeshObject CRhinoDoc::AddBrepObject CRhinoDoc::ReplaceObject CRhinoCurveObject::CRhinoCurveObject() CRhinoDoc::AddObject

◆ AddCurveObject() [5/6]

CRhinoCurveObject* CRhinoDoc::AddCurveObject ( const ON_Line line,
const ON_3dmObjectAttributes pAttributes = NULL,
CRhinoHistory pHistory = NULL,
BOOL32  bReference = 0 
)

Description: Add a line object to Rhino. Parameters: line - [in] (line is copied) pAttributes - [in] (optional) attributes. If NULL, the current default attributes are used. pHistory - [in] (optional) history bReference - [in] true if the point object is from a reference file. Reference objects do not persist in archives. Remarks: This is an easy to use wrapper that creates a new CRhinoCurveObject and calls CRhinoDoc::AddObject. The input line is copied and should be deleted by the caller when its no longer needed. See Also: CRhinoDoc::AddPointObject CRhinoDoc::AddPointCloudObject CRhinoDoc::AddCurveObject CRhinoDoc::AddSurfaceObject CRhinoDoc::AddMeshObject CRhinoDoc::AddBrepObject CRhinoDoc::ReplaceObject CRhinoCurveObject::CRhinoCurveObject() CRhinoDoc::AddObject

◆ AddCurveObject() [6/6]

CRhinoCurveObject* CRhinoDoc::AddCurveObject ( const ON_Polyline polyline,
const ON_3dmObjectAttributes pAttributes = NULL,
CRhinoHistory pHistory = NULL,
BOOL32  bReference = 0 
)

Description: Add a polyline object to Rhino. Parameters: polyline - [in] pAttributes - [in] (optional) attributes. If NULL, the current default attributes are used. pHistory - [in] (optional) history bReference - [in] true if the point object is from a reference file. Reference objects do not persist in archives. Remarks: This is an easy to use wrapper that creates a new CRhinoCurveObject and calls CRhinoDoc::AddObject. The input polyline is copied and should be deleted by the caller when its no longer needed. See Also: CRhinoDoc::AddPointObject CRhinoDoc::AddPointCloudObject CRhinoDoc::AddCurveObject CRhinoDoc::AddSurfaceObject CRhinoDoc::AddMeshObject CRhinoDoc::AddBrepObject CRhinoDoc::ReplaceObject CRhinoCurveObject::CRhinoCurveObject() CRhinoDoc::AddObject

◆ AddCustomUndoEvent()

unsigned int CRhinoDoc::AddCustomUndoEvent ( CRhinoUndoEventHandler undo_event_handler)

Description: If you want to your plug-in to do something when the Rhino Undo/Redo command runs, the call AddCustomUndoEvent during your command.

This function is for expert plug-in developers. If you don't do a good job here, you will really break Rhino. Parameters: undo_event_handler - [in] Pointer to a class allocated with a call to new. Never delete this class. Never pass a pointer to a stack variable. Returns: If a non zero number is returned, then this is the runtime serial number Rhino has assigned to this undo event. If zero is returned, then the user has disabled undo and undo_event_handler was deleted.

◆ AddDimAngularObject() [1/2]

const class CRhinoDimAngular* CRhinoDoc::AddDimAngularObject ( ON_Arc  arc,
double  offset,
const ON_DimStyle dim_style = nullptr,
const ON_3dmObjectAttributes attributes = nullptr 
)

Description: Add an angular dimension to the document. Parameters: arc - [in] offset - [in] See the corresponding version of ON_DimAngular.Create() for a description of these parameters. dim_style - [in] nullptr, document dimension style, or a valid override style. If invalid, then the current dimension style will be used. The CRhinoDoc.DimStyleFromProperties() function is useful for initializing dimension style settings.

◆ AddDimAngularObject() [2/2]

const class CRhinoDimAngular* CRhinoDoc::AddDimAngularObject ( ON_Line  line1,
ON_3dPoint  point_on_line1,
ON_Line  line2,
ON_3dPoint  point_on_line2,
ON_3dPoint  point_on_angular_dimension_arc,
bool  bSetExtensionPoints,
const ON_DimStyle dim_style = nullptr,
const ON_3dmObjectAttributes attributes = nullptr 
)

Description: Add an angular dimension to the document. Parameters: arc - [in] offset - [in] See the corresponding version of ON_DimAngular.Create() for a description of these parameters. dim_style - [in] nullptr, document dimension style, or a valid override style. If invalid, then the current dimension style will be used. The CRhinoDoc.DimStyleFromProperties() function is useful for initializing dimension style settings.

◆ AddDimLinearObject() [1/2]

const class CRhinoDimLinear* CRhinoDoc::AddDimLinearObject ( ON_3dPoint  extension_point0,
ON_3dPoint  extension_point1,
ON_3dPoint  dimension_line_point,
ON_3dVector  plane_normal,
const ON_DimStyle dim_style = nullptr,
const ON_3dmObjectAttributes attributes = nullptr 
)

Description: Add an aligned linear dimension to the document. The dimension line is parallel to the segment connecting the dimension points. Parameters: extension_point0 - [in] extension_point1 - [in] locations of one of the points being dimensioned. The dimension line will be parallel to the segment connecting these points. dimension_line_point - [in] a point on the linear dimension line. plane_normal - [in] A vector perpendicular to the line between the extension points that defines the orientation of the dimension's plane. dim_style - [in] nullptr, document dimension style, or a valid override style. If invalid, then the current dimension style will be used. The CRhinoDoc.DimStyleFromProperties() function is useful for initializing dimension style settings. attributes - [in] nullptr or object attributes.

◆ AddDimLinearObject() [2/2]

const class CRhinoDimLinear* CRhinoDoc::AddDimLinearObject ( ON_3dPoint  extension_point0,
ON_3dPoint  extension_point1,
ON_Line  dimension_line,
ON_3dVector  plane_normal,
const ON_DimStyle dim_style = nullptr,
const ON_3dmObjectAttributes attributes = nullptr 
)

Description: Add a rotated linear dimension to the document. The dimension line is explicitly specified. Parameters: extension_point0 - [in] extension_point1 - [in] locations of one of the points being dimensioned. The dimension line will be parallel to the segment connecting these points. dimension_line - [in] the dimension line. This is treated as an infinite line and the points are automatically calculated. plane_normal - [in] A vector perpendicular to the line between the extension points that defines the orientation of the dimension's plane. The dimension line is projected to this plane. dim_style - [in] nullptr, document dimension style, or a valid override style. If invalid, then the current dimension style will be used. The CRhinoDoc.DimStyleFromProperties() function is useful for initializing dimension style settings. attributes - [in] nullptr or object attributes.

◆ AddExtrusionObject()

CRhinoExtrusionObject* CRhinoDoc::AddExtrusionObject ( const ON_Extrusion extrusion,
const ON_3dmObjectAttributes pAttributes = NULL,
CRhinoHistory pHistory = NULL,
bool  bReference = 0 
)

Description: Add an extrusion object to Rhino. Parameters: extrusion - [in] A duplicate of this extrusion is added to Rhino. pAttributes - [in] (optional) attributes. If NULL, the current default attributes are used. bReference - [in] true if the point object is from a reference file. Reference objects do not persist in archives. Remarks: This is an easy to use wrapper that creates a new CRhinoExtrusionObject and calls CRhinoDoc::AddObject. The input extrusion is copied and should be deleted by the caller when its no longer needed. See Also: CRhinoDoc::AddPointObject CRhinoDoc::AddPointCloudObject CRhinoDoc::AddCurveObject CRhinoDoc::AddSurfaceObject CRhinoDoc::AddMeshObject CRhinoDoc::AddBrepObject CRhinoDoc::ReplaceObject CRhinoCurveObject::CRhinoCurveObject() CRhinoDoc::AddObject

◆ AddGrip()

void CRhinoDoc::AddGrip ( CRhinoGripObject grip)

◆ AddLeaderObject()

const class CRhinoLeader* CRhinoDoc::AddLeaderObject ( const wchar_t *  leader_text,
const ON_Plane plane,
int  leader_polyline_point_count,
const ON_3dPoint leader_polyline_points,
const ON_DimStyle dim_style = nullptr,
const ON_3dmObjectAttributes attributes = nullptr 
)

Description: Create a leader object and add it to the document. Parameters: leader_text - [in] plane - [in] ON_Plane::World_xy or the current view's construction plane are good candidates. The plane origin is ignored leader_polyline_point_count - [in] leader_polyline_points - [in] 3d points (will be projected to the plane) First point is arrow tip and last point is text location. dim_style - [in] If nullptr, document dimension style, or a valid override style. If invalid, then the current dimension style will be used. The ON_DimStyle::CreateFromfProperties() function is useful for getting a good value for this parameter. attributes - [in] If nullptr, current defaults will be used.

Example:

const ON_3dPoint leader_points[3] = { ON_3dPoint(0,0,0), ///< arrow head ON_3dPoint(5,0,0), ON_3dPoint(10,5,0) ///< text location };

/ If you want to specify text appearance or other custom properties ... ON_DimStyle style = ON_DimStyle::DimStyleFromProperties( doc->DimStyleContext().CurrentDimStyle(), ... );

doc->AddLeaderObject( L"Abra Cadabra", ON_Plane::World_xy, 3, leader_points, &style, nullptr );

Remarks: If you need to specify fancier settings, use the version of AddLeaderObject that has a ON_Leader parameter.

◆ AddMeshObject() [1/2]

CRhinoMeshObject* CRhinoDoc::AddMeshObject ( const ON_Mesh mesh,
bool  bRequireValidMesh,
const ON_3dmObjectAttributes pAttributes = NULL,
CRhinoHistory pHistory = NULL,
BOOL32  bReference = 0 
)

Description: Add a mesh object to Rhino. Parameters: mesh - [in] A duplicate of this mesh is added to Rhino. bRequireValidMesh - [in] If true, the mesh will not be added to the Rhino document if it fails a validity check. pAttributes - [in] (optional) attributes. If NULL, the current default attributes are used. bReference - [in] true if the point object is from a reference file. Reference objects do not persist in archives. Remarks: This is an easy to use wrapper that creates a new CRhinoMeshObject and calls CRhinoDoc::AddObject. The input mesh is copied and should be deleted by the caller when its no longer needed. See Also: CRhinoDoc::AddPointObject CRhinoDoc::AddPointCloudObject CRhinoDoc::AddCurveObject CRhinoDoc::AddSurfaceObject CRhinoDoc::AddMeshObject CRhinoDoc::AddBrepObject CRhinoDoc::ReplaceObject CRhinoMeshObject::CRhinoMeshObject() CRhinoDoc::AddObject

◆ AddMeshObject() [2/2]

CRhinoMeshObject* CRhinoDoc::AddMeshObject ( const ON_Mesh mesh,
const ON_3dmObjectAttributes pAttributes = NULL,
CRhinoHistory pHistory = NULL,
BOOL32  bReference = 0 
)

Description: Add a mesh object to Rhino. Parameters: mesh - [in] A duplicate of this mesh is added to Rhino. pAttributes - [in] (optional) attributes. If NULL, the current default attributes are used. bReference - [in] true if the point object is from a reference file. Reference objects do not persist in archives. Remarks: This is an easy to use wrapper that creates a new CRhinoMeshObject and calls CRhinoDoc::AddObject. The input mesh is copied and should be deleted by the caller when its no longer needed. See Also: CRhinoDoc::AddPointObject CRhinoDoc::AddPointCloudObject CRhinoDoc::AddCurveObject CRhinoDoc::AddSurfaceObject CRhinoDoc::AddMeshObject CRhinoDoc::AddBrepObject CRhinoDoc::ReplaceObject CRhinoMeshObject::CRhinoMeshObject() CRhinoDoc::AddObject

◆ AddMruCommand() [1/2]

void CRhinoDoc::AddMruCommand ( const wchar_t *  cmd,
const wchar_t *  display_string,
const wchar_t *  shortcut,
const UINT  modifier_flags 
)

Description: Add MRU command to list, pop old commands off when list reaches max size. Parameters: cmd - [in] command macro to add display_string - [in] String displayed in mru command pop-up menu, if NUL then displays macro. shortcut - [in] String displayed as the shortcut modifier_flags - [in] modifiers for the shortcut (Mac only)

◆ AddMruCommand() [2/2]

void CRhinoDoc::AddMruCommand ( const wchar_t *  cmd,
const wchar_t *  display_string = NULL 
)

Description: Add MRU command to list, pop old commands off when list reaches max size. Parameters: cmd - [in] command macro to add display_string - [in] String displayed in mru command pop-up menu, if NUL then displays macro.

◆ AddObject()

bool CRhinoDoc::AddObject ( CRhinoObject object,
bool  bReferenceObject = false,
bool  bInstanceDefinition = false 
)

Description: Adds an object to the document. The attributes need to be set before you add the object. Use GetDefaultObjectAttributes() to get the current default attributes. Parameters: object - [in] bReferenceObject - [in] if true, the object is added as a reference object that will not be saved bReferenceObject - [in] if true, the object is added as a reference object that will not be saved bInstanceDefinition - [in] if true, the object is added to the instance definition geometry list. The instance definition geometry objects are never directly displayed. They are are referenced by CRhinoInstanceObjects.

Remarks: The object that is being added must be created by calling new to instantiate a class derived from CRhinoObject. Classes like CRhinoPointObject, CRhinoCurveObject, CRhinoSurfaceObject, CRhinoMeshObject, and CRhinoBrepObject can be used.

SeeAlso: CRhinoDoc::AddPointObject CRhinoDoc::AddPointCloudObject CRhinoDoc::AddCurveObject CRhinoDoc::AddSurfaceObject CRhinoDoc::AddMeshObject CRhinoDoc::AddBrepObject CRhinoPointObject::CRhinoPointObject() CRhinoPointCloudObject::CRhinoPointCloudObject() CRhinoCurveObject::CRhinoCurveObject() CRhinoSurfaceObject::CRhinoSurfaceObject() CRhinoBrepObject::CRhinoBrepObject() CRhinoMeshObject::CRhinoMeshObject() CRhinoDoc::ReplaceObject CRhinoDoc::AddObject

◆ AddPointCloudObject()

CRhinoPointCloudObject* CRhinoDoc::AddPointCloudObject ( int  point_count,
const ON_3dPoint point_list,
const ON_3dmObjectAttributes pAttributes = NULL,
CRhinoHistory pHistory = NULL,
BOOL32  bReference = 0 
)

Description: Add a point cloud object to Rhino. Parameters: point_count - [in] number of points in list point_list - [in] array of 3d points pAttributes - [in] (optional) attributes. If NULL, the current default attributes are used. pHistory - [in] (optional) history bReference - [in] true if the point object is from a reference file. Reference objects do not persist in archives. Remarks: This is an easy to use wrapper that creates a new CRhinoPointCloudObject and calls CRhinoDoc::AddObject. The input point_list is copied and should be deleted by the caller when its no longer needed. See Also: CRhinoDoc::AddPointObject CRhinoDoc::AddPointCloudObject CRhinoDoc::AddCurveObject CRhinoDoc::AddSurfaceObject CRhinoDoc::AddMeshObject CRhinoDoc::AddBrepObject CRhinoDoc::ReplaceObject CRhinoPointCloudObjectObject::CRhinoPointCloudObjectObject() CRhinoDoc::AddObject

◆ AddPointObject()

CRhinoPointObject* CRhinoDoc::AddPointObject ( const ON_3dPoint point,
const ON_3dmObjectAttributes pAttributes = NULL,
CRhinoHistory pHistory = NULL,
BOOL32  bReference = 0 
)

Description: Add a point object to Rhino. Parameters: point - [in] (point is copied) pAttributes - [in] (optional) attributes. If NULL, the current default attributes are used. pHistory - [in] (optional) history bReference - [in] true if the point object is from a reference file. Reference objects do not persist in archives. Remarks: This is an easy to use wrapper that creates a new CRhinoPointObject and calls CRhinoDoc::AddObject. The input point is copied and should be deleted by the caller when its no longer needed. See Also: CRhinoDoc::AddPointObject CRhinoDoc::AddPointCloudObject CRhinoDoc::AddCurveObject CRhinoDoc::AddSurfaceObject CRhinoDoc::AddMeshObject CRhinoDoc::AddBrepObject CRhinoDoc::ReplaceObject CRhinoPointObject::CRhinoPointObject() CRhinoDoc::AddObject

◆ AddSurfaceObject()

CRhinoSurfaceObject* CRhinoDoc::AddSurfaceObject ( const ON_Surface surface,
const ON_3dmObjectAttributes pAttributes = NULL,
CRhinoHistory pHistory = NULL,
BOOL32  bReference = 0 
)

Description: Add a surface object to Rhino. Parameters: surface - [in] A duplicate of this surface is added to Rhino. pAttributes - [in] (optional) attributes. If NULL, the current default attributes are used. bReference - [in] true if the point object is from a reference file. Reference objects do not persist in archives. Remarks: This is an easy to use wrapper that creates a new CRhinoSurfaceObject and calls CRhinoDoc::AddObject. The input surface is copied and should be deleted by the caller when its no longer needed. See Also: CRhinoDoc::AddPointObject CRhinoDoc::AddPointCloudObject CRhinoDoc::AddCurveObject CRhinoDoc::AddSurfaceObject CRhinoDoc::AddMeshObject CRhinoDoc::AddBrepObject CRhinoDoc::ReplaceObject CRhinoSurfaceObject::CRhinoSurfaceObject() CRhinoDoc::AddObject

◆ AddTextObject()

const class CRhinoText* CRhinoDoc::AddTextObject ( const wchar_t *  text,
const ON_Plane plane,
const ON_3dPoint  text_location,
const ON_DimStyle dim_style = nullptr,
const ON_3dmObjectAttributes attributes = nullptr 
)

Description: Create a text object and add it to the document. Parameters: text - [in] plane - [in] location specified by valign and halign is at plane.Origin(). dim_style - [in] If nullptr, document dimension style, or a valid override style. If invalid, then the current dimension style will be used. The CRhinoDoc.DimStyleFromTextProperties() function is useful for initializing dimension style settings.

Example:

ON_DimStyle style; / If you want to specify text appearance or other properties ... doc->DimStyleFromTextProperties( ON::AnnotationType::Text,...,&style); / If you want to use current appearance ... style = doc->m_dim_style_table.CurrentDimStyle(); doc->AddLeaderObject( L"Abra Cadabra", ON_Plane::World_xy, ON_3dPoint(1,2,3), &style, nullptr );

Remarks: If you need to specify fancier settings, use the version of AddTextObject that has a ON_Text parameter.

◆ AngleToleranceDegrees()

double CRhinoDoc::AngleToleranceDegrees ( ) const

Returns: Model space angle tolerance. Remarks: Use DocProperties().PageUnitsAndTolerances() for page space.

◆ AngleToleranceRadians()

double CRhinoDoc::AngleToleranceRadians ( ) const

Returns: Model space angle tolerance. Remarks: Use DocProperties().PageUnitsAndTolerances() for page space.

◆ AppendPageView()

void CRhinoDoc::AppendPageView ( class CRhinoPageView pageView)

Description: Append page view window to list of page views for this model. Parameters: pageView: [in] CRhinoPageView to be added

◆ ArrangeViews()

int CRhinoDoc::ArrangeViews ( bool  bMakeVisible) const

Description: Arrange the placements of the document's views. Parameters: rect - [in] Typically, this is the value returned by RhinoApp().MainFrameViewClientRect() bMakeVisible - [in] True to make the views visible. Returns: Number of views the document has. Remarks: ArrangeViews() does not modify any active view settings and that is intentional.

◆ Audit()

bool CRhinoDoc::Audit ( ON_TextLog text_log,
bool  bAttemptRepair 
)

Audit the contents of the model. Returns true if model is valid. If an error is detected and the ON_TextLog pointer is not NULL, then a description of the error is logged. If bAttemptRepair is true, than Audit attempts to repair any problems it detects.

◆ AutoDelete()

BOOL32 CRhinoDoc::AutoDelete ( void  ) const

◆ AutomaticallySetActiveRhinoViewSerialNumber()

unsigned int CRhinoDoc::AutomaticallySetActiveRhinoViewSerialNumber ( unsigned int  ineligible_rhino_view_sn)

Description: Insures the document has an active view if at all possible. Parameters: ineligible_rhino_view_sn - [in] Any view with this serial number will not be used. This parameter is useful when a view will soon be deleted, hidden, or otherwise rendered useless as an active view and should not be considered as a candidate for the documents active view. Returns: The serial number of the document's active view.

◆ BeginUndoRecord() [1/2]

bool CRhinoDoc::BeginUndoRecord ( const CRhinoCommand )

OBSOLETE Call CRhinoDoc::BeginUndoRecordEx(...)

◆ BeginUndoRecord() [2/2]

bool CRhinoDoc::BeginUndoRecord ( const wchar_t *  sActionDescription)

OBSOLETE Call CRhinoDoc::BeginUndoRecordEx(...)

◆ BeginUndoRecordEx() [1/2]

unsigned int CRhinoDoc::BeginUndoRecordEx ( const CRhinoCommand )

Description: Used to begin recording undo information when a command starts. Example:

    unsigned int undo_record_sn = BeginUndoRecordEx(...);
    ...
    doc->EndUndoRecord(undo_record_sn);

Returns: Serial number of record. Returns 0 if record is not started because undo information is already being recorded or undo is disabled.

◆ BeginUndoRecordEx() [2/2]

unsigned int CRhinoDoc::BeginUndoRecordEx ( const wchar_t *  sActionDescription)

Description: Used to begin recording undo information when the document is changed outside of a command. An example begin changes caused by the modeless layer or object properties dialogs when commands are not running. Example:

    unsigned int undo_record_sn = BeginUndoRecordEx(...);
    ...
    doc->EndUndoRecord(undo_record_sn);

Returns: Serial number of record. Returns 0 if record is not started because undo information is already being recorded or undo is disabled.

◆ BeginWaitCursor()

void CRhinoDoc::BeginWaitCursor ( )

◆ BoundingBox()

const ON_BoundingBox& CRhinoDoc::BoundingBox ( bool  bTight,
bool  bIncludeCustomRenderMeshes,
bool  bIncludeCurves 
) const

Description: Get a bounding box of all the visible geometry in the model. The wireframe icons used to display render lights are NOT included. Page space geometry is NOT included Returns; bounding box See Also CRhinoLightTable::WireframeIconsBoundingBox( const CRhinoView* )

Deprecated:
Prefer version with three arguments const ON_BoundingBox& BoundingBox(bool bIncludeCustomRenderMeshes = true) const;

Description: Get a tight bounding box of all the visible geometry in the model. The wireframe icons used to display render lights are NOT included. Page space geometry is NOT included Returns; bounding box See Also CRhinoLightTable::WireframeIconsBoundingBox( const CRhinoView* ) CRhinoObject::GetTightBoundingBox

Deprecated:
Prefer BoundingBox function with three arguments const ON_BoundingBox& TightBoundingBox(bool bIncludeCustomRenderMeshes = true) const;

Description: Get a bounding box of all the visible geometry in the model. The wireframe icons used to display render lights are NOT included. Page space geometry is NOT included / bTight: [in] use CRhinoObject::TightBoundingBox in the calculation instead of BoundingBox / bIncludeCustomRenderMeshes: [in] Resolve custom render meshes for all objects and use those / bIncludeCurves: [in] include curves and annotations in the calculation Returns; bounding box See Also CRhinoLightTable::WireframeIconsBoundingBox( const CRhinoView* ) CRhinoObject::GetTightBoundingBox

◆ CameraIcon()

class CRhCameraIcon* CRhinoDoc::CameraIcon ( CRhinoView view = 0) const

Description: Determine if a camera icon is begin shown. Parameters: view - [in] if NULL, then all views are tested. if not NULL, then just view is tested. Returns: If a camera icon is on, a pointer to the view whose camera is begin shown is returned. If no camera icon is on, NULL is returned.

◆ ChangeTitleToUnNamed()

void CRhinoDoc::ChangeTitleToUnNamed ( )

◆ ClearMarks()

void CRhinoDoc::ClearMarks ( CRhinoObjectIterator ,
int  = 0 
)

Set all object marks to mark_value. See CRhinoObject::Mark() and CRhinoObject::IsMarked(). The mark values are for general runtime use and do not persist through save or copy operations.

◆ ClearPathName()

void CRhinoDoc::ClearPathName ( void  )

◆ ClearReadFileResult()

void CRhinoDoc::ClearReadFileResult ( )

Description: Set the value returned by ReadFileResult() to CRhinoDoc::eReadFileResult::Unset. Typically this happens after Rhino has handled the read in whatever way is appropriate.

◆ ClearRedoRecords()

void CRhinoDoc::ClearRedoRecords ( )

◆ ClearUndoRecords() [1/2]

void CRhinoDoc::ClearUndoRecords ( bool  = false)

◆ ClearUndoRecords() [2/2]

void CRhinoDoc::ClearUndoRecords ( unsigned int  undo_record_sn,
bool  bPurgeDeletedObjects 
)

◆ CloseAllDocuments()

static unsigned int CRhinoDoc::CloseAllDocuments ( )
static

Description: Silently closes all documents. Returns: Number of documents that are closed.

◆ CloseAllOtherDocuments()

unsigned int CRhinoDoc::CloseAllOtherDocuments ( ) const

Description: Silently closes all documents except this document. Returns: Number of documents that are closed.

◆ CloseDocument()

static bool CRhinoDoc::CloseDocument ( unsigned int  rhino_doc_sn)
static

Description: Silently closes the specified document. Parameters: rhino_doc_sn - [in] Runtime serial number of the CRhinoDoc to close. Returns: True if the serial number was valid and the doc with this serial number was destroyed. False if no existing document has this serial number. Remarks: The modified flag is ignored.

◆ CloseRhinoView()

bool CRhinoDoc::CloseRhinoView ( CRhinoView pView)

Description: Close specified Rhino view. Parameters: pView [i] View to close Returns: Returns true on success; otherwise false

◆ CommandToRepeat()

const CRhinoApp::CRhMruCommandRecord* CRhinoDoc::CommandToRepeat ( ) const

◆ ComponentNameFromCandidateName()

const ON_wString CRhinoDoc::ComponentNameFromCandidateName ( ON_ModelComponent::Type  component_type,
bool  bMakeUniqueAndValid,
const wchar_t *  candidate_name 
) const

Description: When a component is being added to a model, there are cases when the name will be modified. If the component is from a reference file like a worksession reference or a linked instance definition with reference layers, then a prefix is added to the name. If the name is empty or not unique and bMakeUniqueAndValid is true, then a suffix is added to the name. Parameters: component_type - [in] Type of component. bMakeUniqueAndValid - [in] If true, then empty names and names already in use are modified to be valid and unique. candidate_name - [in] Candidate for the component name. Remarks: This function is used internally when block definitions, annotation styles, line patterns, and hatch patterns are added to the document. When something like a file reading plug-in must know what name will be assigned to the component ahead of time, it can use this function.

◆ ConstructionPlaneCount()

int CRhinoDoc::ConstructionPlaneCount ( ) const

◆ Contents()

const class IRhRdkContents& CRhinoDoc::Contents ( ) const

◆ CreateDefaultDimstyles()

int CRhinoDoc::CreateDefaultDimstyles ( ON_ClassArray< ON_DimStyle > &  dimstyles)

Creates some default dimstyles and stores them in the dimstyles array returns the number of styles made

◆ CreateDimAngularObject()

class CRhinoDimAngular* CRhinoDoc::CreateDimAngularObject ( const ON_DimAngular dim_angular,
const ON_3dmObjectAttributes attributes = nullptr 
) const

Description: Create an angular dimension object. Caller must add this object to the document. Parameters: dim_angular - [in] attributes - [in] Returns: A pointer of a CRhinoDimAngular that can be modified. You must use CRhinoDoc.AddObject() to add this to the document. Remarks: If you need a simple angular dimension with default settings, use one of the AddDimAnglularObject() functions.

◆ CreateDimLinearObject()

class CRhinoDimLinear* CRhinoDoc::CreateDimLinearObject ( const ON_DimLinear dim_linear,
const ON_3dmObjectAttributes attributes = nullptr 
) const

Description: Create an linear dimension object. Caller must add this object to the document. Parameters: dim_linear - [in] attributes - [in] Returns: A pointer of a CRhinoDimLinear that can be modified. You must use CRhinoDoc.AddObject() to add this to the document. Remarks: If you need a simple linear dimension with default settings, use one of the AddDimAnglularObject() functions.

◆ CreateDocument()

static unsigned int CRhinoDoc::CreateDocument ( const wchar_t *  sModelTemplateFileName,
const CRhinoCreateDocumentOptions create_document_options 
)
static

Description: Creates an new CRhinoDoc.

Parameters: sModelTemplateFileName - [in]

  • If null or empty, an empty document is created with no views. This is what you want to do if the next thing you are going to do is to read a file.
  • If not empty, this parameter specifies the name of a Rhino model to use as a template to initialize the document. If the template contains views, those views are created. This is what you want to do if you are creating a new empty document and want to start with specified layers, tolerance, unit systems, and so on.
  • The function RhinoApp().AppSettings().FileSettings().m_default_template_file returns the Rhino application default template file. create_document_options - [in] Use this parameter to set options if you do not want the default behavior. Returns: Runtime serial number of the new CRhinoDoc.

◆ CreateLeaderObject() [1/2]

class CRhinoLeader* CRhinoDoc::CreateLeaderObject ( const ON_Leader leader,
const ON_3dmObjectAttributes attributes = nullptr 
) const

Description: Create a leader object. Caller must add it to the document. Parameters: leader - [in] attributes - [in] If nullptr, current defaults will be used. Remarks: If you need a simple leader object with default settings, use the version of AddLeaderObject() that takes a string, plane and points. The CRhinoDoc.DimStyleFromTextProperties() function is useful for initializing dimension style settings.

◆ CreateLeaderObject() [2/2]

class CRhinoLeader* CRhinoDoc::CreateLeaderObject ( const wchar_t *  leader_text,
const ON_Plane plane,
int  leader_polyline_point_count,
const ON_3dPoint leader_polyline_points,
const ON_DimStyle dim_style = nullptr,
const ON_3dmObjectAttributes attributes = nullptr 
) const

Description: Create a leader object. Caller must add it to the document. Parameters: leader_text - [in] plane - [in] ON_Plane::World_xy or the current view's construction plane are good candidates. The plane origin is ignored leader_polyline_point_count - [in] leader_polyline_points - [in] 3d points (will be projected to the plane) First point is arrow tip and last point is text location. dim_style - [in] If nullptr, document dimension style, or a valid override style. If invalid, then the current dimension style will be used. The ON_DimStyle::CreateFromProperties() function is useful for getting a good value for this parameter. attributes - [in] If nullptr, current defaults will be used. Remarks: If you need to specify fancier settings, use the version of AddLeaderObject that has a ON_Leader parameter.

◆ CreateRhinoPageView()

unsigned int CRhinoDoc::CreateRhinoPageView ( const wchar_t *  title = nullptr)

Description: Create a new page view window. Parameters: title: [in] string that appears in the new page view's title window If NULL, the name will be generated as "Page #" where this is the largest page number. Returns: The runtime serial number of a view or zero if the input was not valid. Remarks : Use CRhinoView::FromRuntimeSerialNumber() to get a pointer to the view.

◆ CreateRhinoView() [1/2]

unsigned int CRhinoDoc::CreateRhinoView ( const ON_3dmView view,
bool  bShowView 
)

Description: Creates a new Rhino view. Parameters: view - [in] null or settings to use to initialize the view. pMfcViewRuntimeClass - [in] null or a runtime class derived from CRhinoView. bShowView - [in] If false, the view will not be shown. This is what you should do if you need to perform additional initialization on the view before it appears. If true, the view will be shown and updated. Returns: The runtime serial number of a view or zero if the input was not valid. Remarks: Use CRhinoView::FromRuntimeSerialNumber() to get a pointer to the view.

◆ CreateRhinoView() [2/2]

unsigned int CRhinoDoc::CreateRhinoView ( const ON_3dmView view,
CRuntimeClass *  pMfcViewRuntimeClass,
bool  bShowView 
)

◆ CreateTextObject() [1/2]

class CRhinoText* CRhinoDoc::CreateTextObject ( const ON_Text text,
const ON_3dmObjectAttributes attributes = nullptr 
) const

Description: Create a text object. Caller must add this object to the document. Parameters: text - [in] Remarks: If you need a simple text object with default settings, use the version of AddTextObject() that takes a string and plane. The CRhinoDoc.DimStyleFromTextProperties() function is useful for initializing dimension style settings.

◆ CreateTextObject() [2/2]

class CRhinoText* CRhinoDoc::CreateTextObject ( const wchar_t *  text,
const ON_Plane plane,
const ON_3dPoint  text_location,
const ON_DimStyle dim_style = nullptr,
const ON_3dmObjectAttributes attributes = nullptr 
) const

Description: Create a text object. Caller must add this object to the document. Parameters: text - [in] plane - [in] location specified by valign and halign is at plane.Origin(). dim_style - [in] If nullptr, document dimension style, or a valid override style. If invalid, then the current dimension style will be used. The CRhinoDoc.DimStyleFromTextProperties() function is useful for initializing dimension style settings.

Example:

ON_DimStyle style; / If you want to specify text appearance or other properties ... doc->DimStyleFromTextProperties( ON::AnnotationType::Text,...,&style); / If you want to use current appearance ... style = doc->m_dim_style_table.CurrentDimStyle(); doc->AddLeaderObject( L"Abra Cadabra", ON_Plane::World_xy, ON_3dPoint(1,2,3), &style, nullptr );

Remarks: If you need to specify fancier settings, use the version of AddTextObject that has a ON_Text parameter.

◆ CreateViewLayout()

void CRhinoDoc::CreateViewLayout ( int  view_count,
const ON_3dmView views 
)

Description: Destroy all existing views and create a new set of views based on a set of ON_3dmView objects. Similar to ReplaceModelViews, except this function removes all existing views. Parameters: view_count: [in] number of objects in views array views: [in] array of ON_3dmViews

◆ CullUndoRecords() [1/2]

int CRhinoDoc::CullUndoRecords ( )

Description: Culls the undo list to release memory. Parameters: min_step_count - [in] minimum number of undo steps to keep. max_memory_size_bytes - [in] maximum amount of memory, in bytes, for undo list to use. Returns: Number of culled records. Remarks: In the version with no arguments, the settings in RhinoApp().AppSettings().GeneralSettings() are used.

◆ CullUndoRecords() [2/2]

int CRhinoDoc::CullUndoRecords ( int  min_step_count,
size_t  max_memory_size_bytes 
)

◆ CurrentEnvironment()

const class IRhRdkCurrentEnvironment& CRhinoDoc::CurrentEnvironment ( ) const
Deprecated:
Use Properties().RenderSettings() Render Environment functions instead. See comments above.

◆ CurrentUndoRecord()

CRhUndoRecord* CRhinoDoc::CurrentUndoRecord ( ) const

Returns: Record being currently recorded. If undo recording is disabled or nothing is currently being recorded, then NULL is returned.

◆ CurrentUndoRecordSerialNumber()

unsigned int CRhinoDoc::CurrentUndoRecordSerialNumber ( ) const

Returns: >0: undo recording is active and being saved on the undo record with the specified serial number. 0: undo recording is not active. (Disabled or nothing is being recorded.)

◆ DefaultDimstyleNamePrefix()

static const wchar_t* CRhinoDoc::DefaultDimstyleNamePrefix ( )
static

< SHARED_HANDLERS

Returns a translated string to use prepend to a Dimstyle name to mark it as a built-in default dimstyle

◆ DefaultObjectAttributes()

const ON_3dmObjectAttributes CRhinoDoc::DefaultObjectAttributes ( ) const

◆ DefaultViewLayout() [1/2]

void CRhinoDoc::DefaultViewLayout ( )

◆ DefaultViewLayout() [2/2]

void CRhinoDoc::DefaultViewLayout ( ON_BoundingBox  model_bbox)

◆ DeferredRedraw()

void CRhinoDoc::DeferredRedraw ( void  )

Description: Redraw all views of the active document with a regenerate display hint. This version of Redraw will cause all views to update, but not in any particular order or any specific time. All you can be assured of is that the views will eventually update...

Parameters:

Remarks: The routine basically iterates through all views calling CRhinoView::Redraw()...

See Also CRhinoView::Redraw()

◆ DeleteObject()

bool CRhinoDoc::DeleteObject ( const CRhinoObjRef objref,
bool  bQuiet = true,
bool  bIgnoreModes = false 
)

Description: Deletes objref.Object(). The deletion can be undone by calling UndeleteObject(). Parameters: objref - [in] objref.Object() will be deleted bQuiet = [in] if false, a message box will appear when an object cannot be deleted. bIgnoreModes - [in] If true, locked and hidden objects are transformed. If false objects that are locked, hidden, or on locked or hidden layers are not transformed.

◆ DimStyleContext()

const CRhinoDimStyleContext CRhinoDoc::DimStyleContext ( ) const

Returns: An class derived from ON_DimStyleContext that can be used whenever an ON_DimStyleContext& parameter is required.

◆ DisplayEngineStatus()

int CRhinoDoc::DisplayEngineStatus ( int  engine_id) const

Description: Return the status of the display engine: Parameters: engine_id - [in] CRhinoDoc::display_engine_opengl or CRhinoDoc::display_engine_direct3d Returns: 0: Engine is not available. 1: Engine is available, but not initialized. 2: Engine is available and initialized.

◆ Dithering()

const class IRhRdkDithering& CRhinoDoc::Dithering ( ) const
Deprecated:
Use Properties().RenderSettings().Dithering() instead. See comments above.

◆ DocStatus()

enum CRhinoDocStatus CRhinoDoc::DocStatus ( ) const

◆ DocumentCount()

static unsigned int CRhinoDoc::DocumentCount ( )
static

Returns: Number of documents.

◆ DocumentMissingFontTest()

unsigned int CRhinoDoc::DocumentMissingFontTest ( bool  bInteractive,
unsigned int  begin_dimstyle_search_at_sn,
unsigned int  begin_object_search_at_sn 
)

Parameters: bInteractive - [in] If true and missing fonts are found, a modeless dialog UI is used to inform the user and ask what to do about the missing fonts. begin_dimstyle_search_at_sn - [in] To test all dimstyles, pass 0. To test no dimstyles, pass 0xFFFFFFFFU. To test all dimstyles created during some event, save the value of CRhinoDimStyle::NextRuntimeSerialNumber() before the event and then call GetMissingFontLists() after the event with the saved value as the this parameter. begin_object_search_at_sn - [in] To test all objects, pass 0. To test no objects, pass 0xFFFFFFFFU. To test all objects created during some event, save the value of CRhinoObject::NextRuntimeObjectSerialNumber() before the event and then call GetMissingFontLists() after the event with the saved value as the this parameter. Returns: Number of fonts referenced in the searched dimstyles and objects that are not installed on the current device. Remarks: Deleted dimstyles and deleted objects are always ignored.

◆ DoFileSave()

BOOL32 CRhinoDoc::DoFileSave ( )

◆ DoSave()

BOOL32 CRhinoDoc::DoSave ( LPCTSTR  lpszPathName,
BOOL32  bReplace = TRUE 
)

◆ EnableCameraIcon()

void CRhinoDoc::EnableCameraIcon ( CRhinoView view)

Description: Use to turn camera icon on and off. Parameters: view - [in] If NULL, any camera icon is turned off. If not NULL, the camera icon for that view is turned on.

◆ EnableGet()

CRhinoGet* CRhinoDoc::EnableGet ( CRhinoGet )

For use by CRhinoGetPoint::GetPoint(), CRhinoGetPoint::GetObject(), CRhinoGetString()

◆ EnableUndoRecording()

void CRhinoDoc::EnableUndoRecording ( bool  = true)

◆ EnableValidateNewObjects()

void CRhinoDoc::EnableValidateNewObjects ( bool  bEnable)

Parameters: bEnable - [in] true: CRhinoDoc::AddObject() is validates each object as it is added. If the object is not valid, the count of This can be time consuming but is valuable for debugging. false: CRhinoDoc::AddObject() dos not validate objects. Returns: True if CRhinoDoc::AddObject() is validating each object as it is added. This can be time consuming but is valuable for debugging.

◆ EndUndoRecord() [1/3]

bool CRhinoDoc::EndUndoRecord ( )

<- OBSOLETE

CRhinoDoc::EndUndoRecord() is OBSOLETE Call EndUndoRecord(undo_record_sn) where undo_record_sn is the value returned by BeginUndoRecordEx(...)

◆ EndUndoRecord() [2/3]

bool CRhinoDoc::EndUndoRecord ( unsigned int  undo_record_sn)

Description: End current undo if its serial number satisfies undo_record_sn0 <= sn <= undo_record_sn1.

◆ EndUndoRecord() [3/3]

bool CRhinoDoc::EndUndoRecord ( unsigned int  undo_record_sn0,
unsigned int  undo_record_sn1 
)

End undo if its serial number satisfies undo_record_sn0 <= sn <= undo_record_sn1.

◆ EndWaitCursor()

void CRhinoDoc::EndWaitCursor ( )

◆ EnterCommand()

void CRhinoDoc::EnterCommand ( const CRhinoCommand cmd,
unsigned int *  undo_record_sn 
)

◆ EventManager()

class CRhEventManager* CRhinoDoc::EventManager ( void  ) const

ON_RUNTIME_APPLE.

list of events (text tokens, view clicks, digitizer points, etc.

  • exposed for expert users - do not modify

◆ ExecuteCommand()

CRhinoCommand::result CRhinoDoc::ExecuteCommand ( const wchar_t *  cmd_name)

Description: In general, you should use CRhinoApp::RunScript to run commands unless you are trying to modify the Rhino model from a modeless dialog. See the example below for how to handle the modeless dialog situation.

This is a low level tool that searches for a command (a instance of a class derived from CRhinoCommand) with a matching command name, if it finds a command, runs that command by calling the virtual CRhinoCommand::RunCommand() member function.

The command name can be prefaced with a combination of underbar (_), hyphen (-), or right single quote ('). If an underbar is present, then the command name search looks for a matching english command name. If the underbar is not present, the command name search looks for a matching localized command name. If the hyphen is present, then the command is run in script mode; otherwise the command is run in interactive mode. The right single quote is ignored by ExecuteCommand. It is used in scripts to indicate that the text token must be treated as a command name and is important to upstream text token parsing.

Example:

CMyCommand : pubic CRhinoCommand { public: RunCommand(...);

type1 m_my_info1; type2 m_my_info2; bool m_bOkToRunCommand; };

CMyCommand::CMyCommand() { m_bOkToRunCommand = false; }

CMyCommand theMyCommand;

CMyCommand::RunCommand(...) { if (!m_bOkToRunCommand) { RhinoMessageBox(L"Use the MyDialog button to run this command"); return CRhinoCommand::failure; }

/ the dialog has filled in m_my_info1 and m_my_info2. / Use this as the "input" to the command and then / do whatever you need to as if the command were / an ordinary command.

...

return CRhinoCommand::success; }

...

CMyDialog::OnButtonDown(...) { / fill in the parameters theMyCommand.m_my_info1 = ...; theMyCommand.m_my_info2 = ...; theMyCommand.m_bOkToRunCommand = true; RhinoApp().ExectueCommand(theMyCommand.LocalCommandName()); theMyCommand.m_bOkToRunCommand = false; }

Returns: Command return code indicating if the command worked, failed, or was canceled by the user.

◆ ExitCommand()

void CRhinoDoc::ExitCommand ( unsigned int  rhino_doc_sn0,
unsigned int  rhino_doc_sn1,
const CRhinoCommand cmd,
unsigned int  undo_record_sn 
)

◆ FindContentInstance()

const class CRhRdkContent* CRhinoDoc::FindContentInstance ( const ON_UUID instanceId) const

Description: Find a content by its instance id. Top-level contents that are attached to the document will be checked. Parameters: instanceId - [in] the instance id of the content to find. Returns: A pointer to the const content or null if not found. If you want to modify the content you will need to call BeginChange() to get a non-const reference.

Deprecated:
Use Contents().Find() instead

◆ FindView() [1/3]

bool CRhinoDoc::FindView ( const wchar_t *  title,
ON_3dmView view,
bool  include_standard_views = true,
bool  include_page_views = true 
)

Description: Find the first view in the view list that has the same viewport title. Note the the title string is not guaranteed unique Parameters: title: [in] viewport title to search for view: [out] if a view is found it is copied into this include_standard_views: [in] look at standard rhino views when searching include_page_views: [in] look at page views when searching Return: true if a view is found with the matching title

Deprecated:
use the overload the takes ViewTypeFilter

◆ FindView() [2/3]

bool CRhinoDoc::FindView ( const wchar_t *  title,
ON_3dmView view,
CRhinoView::ViewTypeFilter  view_types 
)
Deprecated:
Should have been const

◆ FindView() [3/3]

bool CRhinoDoc::FindView ( const wchar_t *  title,
ON_3dmView view,
CRhinoView::ViewTypeFilter  view_types 
) const

◆ FlashObjectList()

void CRhinoDoc::FlashObjectList ( ON_SimpleArray< const CRhinoObject * > &  obj_list,
int  flash_style = 1 
)

Description: Cause objects selection state to change momentarily so the object appears to flash on the screen Parameters: obj_list - [in] list of objects to flash flash_style - [in] 0 = invisible - visible flash, 1 = object color - selected color

◆ FourViewLayout() [1/3]

void CRhinoDoc::FourViewLayout ( bool  bUseMatchingViews = false)

◆ FourViewLayout() [2/3]

void CRhinoDoc::FourViewLayout ( ON_BoundingBox  model_bbox,
bool  bThirdAngleProjection,
bool  bUseMatchingViews 
)

◆ FourViewLayout() [3/3]

void CRhinoDoc::FourViewLayout ( ON_BoundingBox  model_bbox,
bool  bUseMatchingViews = false 
)

◆ FromRuntimeSerialNumber()

static CRhinoDoc* CRhinoDoc::FromRuntimeSerialNumber ( unsigned int  doc_runtime_serial_number)
static

Description: Get a pointer to a CRhinoDoc from a runtime_serial number. Parameters: doc_runtime_serial_number - [in] Returns: The document with the matching runtime serial number or null if no document exists. Remarks: The runtime serial number does not persist in 3dm archives and is not unique between instance of Rhino.exe. It should be used whenever you are tempted to save a CRhinoDoc pointer because Rhino documents can be deleted unexpectedly. See Also: CRhinoDoc::RuntimeSerialNumber();

◆ Get3dmAnnotationContext()

void CRhinoDoc::Get3dmAnnotationContext ( class ON_3dmAnnotationContext annotation_context) const

◆ Get3dmSettings()

void CRhinoDoc::Get3dmSettings ( class ON_3dmSettings settings) const

◆ GetDefaultObjectAttributes()

void CRhinoDoc::GetDefaultObjectAttributes ( ON_3dmObjectAttributes ) const

attributes to use for new object

Model

◆ GetDocList() [1/2]

static unsigned int CRhinoDoc::GetDocList ( ON_SimpleArray< unsigned int > &  rhino_doc_sn_list)
static

Description: In most cases, it is easier, faster and more robust to use a CRhinoDocIterator to go through the list of documents. In the rare case when you really do want a list of all existing document serial numbers, use this function. Parameters: rhino_doc_sn_list - [out] list of rhino document serial numbers in increasing order. Returns: Number of rhino document serial numbers in rhino_doc_sn_list[]. See Also: CRhinoDocIterator

◆ GetDocList() [2/2]

static unsigned int CRhinoDoc::GetDocList ( unsigned int  rhino_doc_sn0,
size_t  rhino_doc_sn_list_capacity,
unsigned int *  rhino_doc_sn_list 
)
static

Description: In most cases, it is easier, faster and more robust to use a CRhinoDocIterator to go through the list of documents. In the rare case when you really do want a list of existing document serial numbers, use this function. Parameters: rhino_doc_sn0 - [in] Serial numbers <= rhino_doc_sn0 will not be added to rhino_doc_sn_list[]. rhino_doc_sn_list_capacity - [in] maximum number of elements in rhino_doc_sn_list[] array. rhino_doc_sn_list - [out] list of rhino document serial numbers > rhino_doc_sn0. Returns: Number of rhino documents set in rhino_doc_sn_list[]. See Also: CRhinoDocIterator

◆ GetDocTemplate()

CDocTemplate* CRhinoDoc::GetDocTemplate ( ) const

◆ GetEmbeddedFilesList()

virtual void CRhinoDoc::GetEmbeddedFilesList ( TextureReportFilter  filter,
ON_ClassArray< ON_wString > &  sFiles 
) const
virtual

◆ GetFirstViewPosition()

POSITION CRhinoDoc::GetFirstViewPosition ( ) const

◆ GetMRUCommands()

int CRhinoDoc::GetMRUCommands ( ON_ClassArray< ON_wString > &  display_strings,
ON_ClassArray< ON_wString > &  macros 
) const

◆ GetNextView()

CView* CRhinoDoc::GetNextView ( POSITION &  rPosition) const

◆ GetPageViewNumber()

int CRhinoDoc::GetPageViewNumber ( const class CRhinoPageView pageView) const

Description: Get page number of a page view window for this model. Parameters: pageView: [in] CRhinoPageView to be found Returns: page number (starting at 0) of the pageView on success -1 on failure

◆ GetPathName()

ON_wString CRhinoDoc::GetPathName ( ) const

CRhinoDimstyleTable* DimstyleTable();.

Re-implement CDocument

◆ GetRedoRecords()

int CRhinoDoc::GetRedoRecords ( ON_SimpleArray< class CRhUndoRecord * > &  ) const

Returns: Number of undo records.

◆ GetTitle()

ON_wString CRhinoDoc::GetTitle ( void  ) const

◆ GetUndoRecords()

int CRhinoDoc::GetUndoRecords ( ON_SimpleArray< class CRhUndoRecord * > &  ) const

Returns: Number of undo records.

◆ GetUntitledDocName()

static void CRhinoDoc::GetUntitledDocName ( ON_wString sUntitledDocName)
static

◆ GetUserString()

bool CRhinoDoc::GetUserString ( const wchar_t *  key,
ON_wString string_value 
) const

Description: Get user string from the document. Parameters: key - [in] id used to retrieve the string. string_value - [out] Returns: True if a string with id was found.

◆ GetUserStringKeys()

int CRhinoDoc::GetUserStringKeys ( ON_ClassArray< ON_wString > &  user_string_keys) const

Description: Get a list of all user string keys on the document. Parameters: user_string_keys - [out] user string keys are appended to this list. Returns: Number of elements appended to the user_strings list.

◆ GetUserStrings()

int CRhinoDoc::GetUserStrings ( ON_ClassArray< ON_UserString > &  user_strings) const

Description: Get a list of all user strings on the document. Parameters: user_strings - [out] user strings are appended to this list. Returns: Number of elements appended to the user_strings list.

◆ GetViewList() [1/2]

int CRhinoDoc::GetViewList ( ON_SimpleArray< CRhinoView * > &  view_list,
bool  include_standard_views = true,
bool  include_page_views = true 
)

Description: Gets an array of all the views. Parameters: view_list - [out] list of views include_standard_views - [in] add standard views to the view_list include_page_views - [in] add page views to the view list Returns: Number of views.

Deprecated:
Use the version that takes a CRhinoView::ViewTypeFilter.

◆ GetViewList() [2/2]

int CRhinoDoc::GetViewList ( ON_SimpleArray< CRhinoView * > &  view_list,
CRhinoView::ViewTypeFilter  filter 
) const

Description: Gets an array of all the views. Parameters: view_list - [out] list of views filter - [in] enum specifying the types of views to include in the list Returns: Number of views.

◆ GetWriteFileOptonsAndWrite() [1/2]

bool CRhinoDoc::GetWriteFileOptonsAndWrite ( CRhinoFileWriteOptions  fwo_in)

Description: Use CRhinoDoc::GetWriteFileOptonsAndWrite() to get a file name and additional file writing options and then write the file. Parameters: fwo - [in] file writing options fwo_out - [out] When you need to know the actual file writing options that were used, then call the version with an fwo_out parameter. The exact details about what options were used and the file writing status information is returned here. Remarks: GetWriteFileOptonsAndWrite(fwo_in,fwo_out) calls CRhinoDoc::WriteFilePathAndOptionsDialog(fwo_in,false,fwo_out) to get the file name and file writing options and then calls CRhinoDoc::WriteFile(fwo_out,fwo_out) to write the file.

◆ GetWriteFileOptonsAndWrite() [2/2]

bool CRhinoDoc::GetWriteFileOptonsAndWrite ( CRhinoFileWriteOptions  fwo_in,
CRhinoFileWriteOptions fwo_out 
)

◆ GroundPlane()

const class IRhRdkGroundPlane& CRhinoDoc::GroundPlane ( ) const
Deprecated:
Use Properties().RenderSettings().GroundPlane() instead. See comments above.

◆ HasUndoRecords()

bool CRhinoDoc::HasUndoRecords ( ) const

Returns true if document contains undo records.

◆ HeadRuntimeSerialNumber()

static unsigned int CRhinoDoc::HeadRuntimeSerialNumber ( )
static

Returns: The serial number of the oldest document that exists or 0 if no documents exist. This will be the smallest serial number of any document that currently exits.

◆ HideObject()

bool CRhinoDoc::HideObject ( const CRhinoObjRef objref,
bool  bIgnoreLayerMode = false 
)

hides object in document

Description: If objref.Object()->IsNormal() is true, then the object will be hidden. Parameters: objref - [in] reference to object to hide bIgnoreLayerMode - [in] if true, the object will be hidden even if it is on a layer that is locked or off. Returns: true if the object was successfully hidden. See Also: CRhinoDoc::ShowObject CRhinoDoc::LockObject

◆ ImportPlugInFileReadInProgress()

bool CRhinoDoc::ImportPlugInFileReadInProgress ( ) const

Returns: True if a file import plug-in is actively reading a file.

◆ InCommand()

int CRhinoDoc::InCommand ( bool  bIgnoreScriptRunnerCommands = false) const

Description: This is a low level tool to determine if Rhino is currently running a command. Parameters: bIgnoreScriptRunnerCommands - [in] if true, script running commands like "ReadCommandFile" and the RhinoScript plug-ins "RunScript" are not counted. Returns: Number of active commands.

◆ InGet()

CRhinoGet* CRhinoDoc::InGet ( ) const

Returns non-null if currently in a CRhinoGetPoint::GetPoint(), CRhinoGetObject::GetObject(), or CRhinoGetString::GetString()

◆ InGetColor()

CRhinoGetColor* CRhinoDoc::InGetColor ( ) const

Returns non-null if currently in a CRhinoGetString::GetString();.

◆ InGetMeshes()

CRhinoGetMeshes* CRhinoDoc::InGetMeshes ( ) const

Returns non-null if currently in a CRhinoGetString::GetString();.

◆ InGetNumber()

CRhinoGetNumber* CRhinoDoc::InGetNumber ( ) const

Returns non-null if currently in a CRhinoGetString::GetString();.

◆ InGetObject()

CRhinoGetObject* CRhinoDoc::InGetObject ( ) const

Returns non-null if currently in a CRhinoGetPoint::GetObject();.

◆ InGetOption()

CRhinoGetOption* CRhinoDoc::InGetOption ( ) const

Returns non-null if currently in a CRhinoGetString::GetString();.

◆ InGetPoint()

CRhinoGetPoint* CRhinoDoc::InGetPoint ( ) const

Returns non-null if currently in a CRhinoGetPoint::GetPoint();.

◆ InGetString()

CRhinoGetString* CRhinoDoc::InGetString ( ) const

Returns non-null if currently in a CRhinoGetString::GetString();.

◆ InScriptRunnerCommand()

bool CRhinoDoc::InScriptRunnerCommand ( ) const

Description: This is a low level tool to determine if Rhino is currently running a script running command like "ReadCommandFile" or the RhinoScript plug-in's "RunScript". Returns: True if a script running command is active.

◆ InvalidateBoundingBox()

void CRhinoDoc::InvalidateBoundingBox ( ) const

Description: Destroys the cached scene bounding box so that it will be regenerated again. from scratch next time the view is regenerated See Also CRhinoDoc::BoundingBox() const

◆ InvalidObjectCount()

unsigned int CRhinoDoc::InvalidObjectCount ( ) const

Returns: If object validation is enabled ( CRhinoDoc::ValidateNewObjects() is true), then this function returns the number of invalid objects added in the current command. If the value is >= 255, then at least 255 "bad" objects have been added. The count is set to zero when a new command begins.

◆ IsAvailable()

bool CRhinoDoc::IsAvailable ( ) const

Returns: True if the document is available for general use. Is is not being being created, opened, closing, or closed.

◆ IsClosing()

bool CRhinoDoc::IsClosing ( ) const

Returns: True if this document is closing or has been closed.

◆ IsCreating()

bool CRhinoDoc::IsCreating ( ) const

Returns true if the CRhinoDoc::CreateDocument() is in the process of creating a document. Remarks: Use (IsInitializing() && !IsOpening()) to determine if CRhinoDoc::CreateDocument() is creating a document.

◆ IsDocumentLocked()

bool CRhinoDoc::IsDocumentLocked ( ) const

Description: Check to see if the file associated with this document is locked. If it is locked then this is the only document that will be able to write the file. Other instances of Rhino will fail to write this document. Returns: Returns true if the document is locked otherwise false. See Also: CRhinoDoc::LockDocument CRhinoDoc::UnLockDocument

◆ IsDocumentReadOnly()

bool CRhinoDoc::IsDocumentReadOnly ( ) const

Description: This method identifies the current read-only mode for this document. Returns: Returns true if the document is can be viewed but NOT saved. Returns false if document can be viewed and saved.

◆ IsHeadless()

bool CRhinoDoc::IsHeadless ( ) const

◆ IsInitializing()

bool CRhinoDoc::IsInitializing ( ) const

Returns (IsCreating() or IsOpening()).

◆ IsModified()

BOOL32 CRhinoDoc::IsModified ( void  ) const

◆ IsOpening()

bool CRhinoDoc::IsOpening ( ) const

Returns true if the CRhinoDoc::OpenDocument() has created a document and is in the process of reading the model file. Remarks: Use (IsInitializing() && !IsOpening()) to determine if CRhinoDoc::CreateDocument() is creating a document.

◆ IsValidDocPointer()

static bool CRhinoDoc::IsValidDocPointer ( const void *  rhino_doc)
static

Returns: True if the rhino_doc pointer is null or points to an existing CRhinoDoc. Remarks: Calling CRhinoDoc::IsValidDocPointer() is fast and should be used before dereferencing a CRhinoDoc pointer that could possibly be invalid. For example, CRhinoView::GetDocument() uses CRhinoDoc::IsValidDocPointer() to validate the pointer saved by MFC before returning it.

◆ IsValidDocReference()

static bool CRhinoDoc::IsValidDocReference ( const CRhinoDoc rhino_doc)
static

Returns: True if the rhino_doc reference is valid and refers to an existing CRhinoDoc. Remarks: Calling CRhinoDoc::IsValidDocReference() is fast and should be used before using a CRhinoDoc reference that could possibly be invalid.

◆ LinearWorkflow()

const class IRhRdkLinearWorkflow& CRhinoDoc::LinearWorkflow ( ) const
Deprecated:
Use Properties().RenderSettings().LinearWorkflow() instead. See comments above.

◆ LockObject()

bool CRhinoDoc::LockObject ( const CRhinoObjRef objref,
bool  bIgnoreLayerMode = false 
)

locks object in document

Description: If objref.Object()->IsNormal() is true, then the object will be locked. Parameters: objref - [in] reference to normal object to lock bIgnoreLayerMode - [in] if true, the object will be locked even if it is on a layer that is locked or off. Returns: true if the object was successfully hidden. See Also: CRhinoDoc::UnlockObject CRhinoDoc::HideObject

◆ LookupDocumentObject()

const ON_Object* CRhinoDoc::LookupDocumentObject ( ON_UUID  id,
bool  bIgnoreDeleted 
) const

Description: Lookup any document object (geometry, layers, materials, fonts, ...) by id. Returns: NULL or a pointer to the document object.

◆ LookupObject() [1/6]

int CRhinoDoc::LookupObject ( const CRhinoGroup ,
ON_SimpleArray< CRhinoObject * > &   
) const

◆ LookupObject() [2/6]

int CRhinoDoc::LookupObject ( const CRhinoLayer ,
ON_SimpleArray< const CRhinoObject * > &   
) const

◆ LookupObject() [3/6]

int CRhinoDoc::LookupObject ( const CRhinoLayer ,
ON_SimpleArray< CRhinoObject * > &   
) const

◆ LookupObject() [4/6]

int CRhinoDoc::LookupObject ( const CRhinoLinetype ,
ON_SimpleArray< CRhinoObject * > &   
) const

◆ LookupObject() [5/6]

int CRhinoDoc::LookupObject ( const CRhinoMaterial ,
ON_SimpleArray< CRhinoObject * > &   
) const

◆ LookupObject() [6/6]

const CRhinoObject* CRhinoDoc::LookupObject ( ON_UUID  object_uuid) const

use CRhinoObjectIterator to iterate through CRhinoObject list(s)

objects (geometry, annotation, etc.) object search Remarks: Obsolete function. Use these static functions. CRhinoObject::FromId() CRhinoObject::FromRuntimeSerialNumber()

◆ LookupObjectByRuntimeSerialNumber() [1/2]

const CRhinoObject* CRhinoDoc::LookupObjectByRuntimeSerialNumber ( unsigned int  runtime_serial_number) const

Remarks: Obsolete function. Use these static functions. CRhinoObject::FromId() CRhinoObject::FromRuntimeSerialNumber()

◆ LookupObjectByRuntimeSerialNumber() [2/2]

const CRhinoObject* CRhinoDoc::LookupObjectByRuntimeSerialNumber ( unsigned int  runtime_serial_number,
CRhinoObjectIterator it 
) const

Remarks: Obsolete (and slow) function. Use these static functions. CRhinoObject::FromId() CRhinoObject::FromRuntimeSerialNumber() Then check the result to see if you want to use it.

◆ Manifest()

const ON_ComponentManifest& CRhinoDoc::Manifest ( ) const

◆ ModelComponentCheck()

bool CRhinoDoc::ModelComponentCheck ( const ON_ModelComponent model_component,
int  table_index,
ON_wString error_description 
) const

Description: This is a tool to determine if a model_component is in this CRhinoDoc and correctly entered in the manifest. It is useful for debugging and testing. Parameters: model_component - [in] table_index - [in] If table_index != ON_UNSET_INT_INDEX and the component requires a unique index, then the index is tested for validity. error_description - [out] If an error is detected, a description is returned here. Returns: If the model_component is in this CRhinoDoc and everything is correctly set, then true is returned. Otherwise false is returned.

◆ ModelessUserInterfaceDocSerialNumber()

static unsigned int CRhinoDoc::ModelessUserInterfaceDocSerialNumber ( )
static

Returns: The runtime serial number of the document modeless user interface should reference when displaying information. It is often the case the 0 is returned. Remarks:

  • It is rare that this function is required and it should be called sparingly. Never use this function when you are in a command, instead use the doc passed in the command's context parameter.
  • The doc for a command context, the "target" doc, and the "modeless user interface" doc can be three different documents.
  • The core Rhino application decides what document is used here. There is no way for a plug-in to change this value and that is intentional.
  • Modeless user interface should use a CRhinoEventWatcherEx::event_type_modeless_ui_doc_changed event watcher to detect when the modeless user interface document has changed.

◆ ModelName()

const wchar_t* CRhinoDoc::ModelName ( ) const

◆ ModelUnits()

const ON_UnitSystem& CRhinoDoc::ModelUnits ( ) const

◆ ModifyObjectAttributes()

bool CRhinoDoc::ModifyObjectAttributes ( const CRhinoObjRef objref,
const CRhinoObjectAttributes new_attributes,
BOOL32  bQuiet = false 
)

Description: Modifies an object's attributes. Cannot be used to change object id.

Parameters: objref - [in] reference to object to modify new_attributes - [in] new attributes bQuiet - [in] if true, then warning message boxes are disabled.

Returns: true if successful.

◆ ModuleState()

AFX_MODULE_STATE* CRhinoDoc::ModuleState ( void  ) const

◆ MorphObject()

CRhinoObject* CRhinoDoc::MorphObject ( const CRhinoObject old_object,
const ON_SpaceMorph morph,
bool  bAddNewObjectToDoc,
bool  bDeleteOriginal 
)

Description: Creates a new object that is the morph of the existing object and deletes the existing object if bDeleteOriginal is true.

Parameters: old_object - [in] reference to object to morph. The object objref.Object() will be deleted if bDeleteOriginal is true. morph - [in] space morph to apply bAddNewObjectToDoc - [in] if true, the new object is added to the document. if false, the new object is not added to the document. bDeleteOriginal - [in] if true, the original object is deleted if false, the original object is not deleted

Returns: New object that is the morph of the existing_object. The new object has identical attributes.

Remarks: If the object is locked or on a locked layer, then it cannot be transformed.

◆ MruCommandList()

const ON_ClassArray<CRhinoApp::CRhMruCommandRecord>& CRhinoDoc::MruCommandList ( ) const

◆ MruMenuString()

const wchar_t* CRhinoDoc::MruMenuString ( ) const

MRU Commands for this document.

◆ NewView() [1/2]

unsigned int CRhinoDoc::NewView ( const ON_3dmView new_view)

Description: Creates a new view. Parameters: new_view - [in] the view parameters Returns: View serial number.

Deprecated:
use overload that accepts bShowView parameter

◆ NewView() [2/2]

unsigned int CRhinoDoc::NewView ( const ON_3dmView new_view,
bool  bShowView 
)

Description: Creates a new view. Parameters: new_view - [in] the view parameters bShowView - [in] show the view Returns: View serial number.

◆ NextConstructionPlane()

bool CRhinoDoc::NextConstructionPlane ( ON_Plane plane)

◆ NextRuntimeSerialNumber()

static unsigned int CRhinoDoc::NextRuntimeSerialNumber ( )
static

Returns: The serial number of the next document to be constructed. Example: Examine documents created by SomeProcess().

  const unsigned int rhino_doc_sn0 = CRhinoDoc::NextRuntimeSerialNumber();
  SomeProcess();
  const unsigned int rhino_doc_sn1 = CRhinoDoc::NextRuntimeSerialNumber();
  for ( unsigned int rhino_doc_sn = rhino_doc_sn0; rhino_doc_sn < rhino_doc_sn1; rhino_doc_sn++ )
  {
    CRhinoDoc* doc = CRhinoDoc::FromRuntimeSerialNumber(rhino_doc_sn);
    if ( 0 == doc )
      continue;
    ...
  }

◆ NextUndoRecordSerialNumber()

unsigned int CRhinoDoc::NextUndoRecordSerialNumber ( ) const

Returns: The serial number that will be assigned to the next undo record that is constructed.

◆ ObjectFinderIsValid()

bool CRhinoDoc::ObjectFinderIsValid ( ON_TextLog text_log,
unsigned int  max_error_count,
size_t *  sn_count,
size_t *  id_count 
) const

This function is a debugging tool that validates the CRhinoObject lists and m_object_finder. If any errors are detected, false is returned. If no errors is detected, true is returned. Pass in a text_log if you want a description of the errors. Set max_error_count to the number of errors you want to allow before checking is halted.

◆ OnCloseDocument()

void CRhinoDoc::OnCloseDocument ( )

◆ OnNewDocument()

BOOL32 CRhinoDoc::OnNewDocument ( )

◆ OnOpenDocument()

BOOL32 CRhinoDoc::OnOpenDocument ( LPCTSTR  lpszPathName)

◆ OnSaveDocument()

BOOL32 CRhinoDoc::OnSaveDocument ( LPCTSTR  lpszPathName)

◆ OpenDocument()

static unsigned int CRhinoDoc::OpenDocument ( const wchar_t *  sModelFileName,
const CRhinoOpenDocumentOptions open_document_options 
)
static

Description: Creates an new CRhinoDoc.

Parameters: sModelFileName - [in]

  • This parameter specifies the name of a model file to read to initialize document. If the template contains views, those views are created. This is what you want to do if you are creating a new empty document and want to start with specified layers, tolerance, unit systems, and so on. open_document_options - [in] Use this parameter to set options if you do not want the default behavior. Returns: Runtime serial number of the new CRhinoDoc.

◆ PageUnits()

const ON_UnitSystem& CRhinoDoc::PageUnits ( ) const

◆ PageViewDetailIsActive()

void CRhinoDoc::PageViewDetailIsActive ( BOOL32  isActive)

◆ PickObjects() [1/2]

int CRhinoDoc::PickObjects ( const CRhinoPickContext ,
CRhinoObjRefArray  
) const

PickObjects() returns number of objects added to array.

◆ PickObjects() [2/2]

int CRhinoDoc::PickObjects ( const CRhinoPickContext ,
CRhinoObjRefArray ,
bool  bSilent 
) const

PickObjects() returns number of objects added to array.

Parameters
bSilentif true selection filter is applied silently, without flashing the selection filter toolbar

◆ PopSerializeStatus()

class CRhDocSerializeStatus* CRhinoDoc::PopSerializeStatus ( )

◆ PostEffects()

const class IRhRdkPostEffects& CRhinoDoc::PostEffects ( ) const
Deprecated:
Use Properties().RenderSettings().PostEffects() instead. See comments above.

◆ PrevConstructionPlane()

bool CRhinoDoc::PrevConstructionPlane ( ON_Plane plane)

◆ Properties() [1/2]

CRhinoDocProperties& CRhinoDoc::Properties ( )

Return current document properties

◆ Properties() [2/2]

const CRhinoDocProperties& CRhinoDoc::Properties ( ) const

◆ PurgeAnonymousUserTable()

int CRhinoDoc::PurgeAnonymousUserTable ( bool  bQuiet)

◆ PurgeCyclicInstanceReferences()

unsigned int CRhinoDoc::PurgeCyclicInstanceReferences ( )

Description: Searches for and destroys all CRhinoInstanceObject instances in the instance definition geometry table that are at the tail of a cyclic instance reference. Cyclic instance references crash display code. Returns: Number of purged objects. Any value > 0 indicates something managed to create a cyclic instance reference. If the creation point can be found, it should be fixed so it does not create cyclic references.

◆ PurgeLinkedIDefModel()

unsigned int CRhinoDoc::PurgeLinkedIDefModel ( unsigned int  linked_idef_model_sn)

Parameters: linked_idef_model_sn - [in] If 0, then all linked instance definition objects are purged. If non-zero, then linked instance definition objects with a matching serial number are purged. Returns: Number of purged objects

◆ PurgeObject()

bool CRhinoDoc::PurgeObject ( CRhinoObject *&  object)

Description: Removes object from document and deletes the pointer.

Parameters: object - [in,out] pointer to object to purge. This object is deleted and the pointer is set to NULL.

◆ PurgeWorkSessionReferenceModel()

unsigned int CRhinoDoc::PurgeWorkSessionReferenceModel ( unsigned int  worksession_ref_model_sn)

Parameters: worksession_ref_model_sn - [in] If 0, then all work session reference models are purged. If non-zero, then reference objects with a matching serial number are purged. Returns: Number of purged objects

◆ PushConstructionPlane()

void CRhinoDoc::PushConstructionPlane ( const ON_Plane plane)

Universal construction plane stack operators

◆ PushSerializeStatus()

void CRhinoDoc::PushSerializeStatus ( class CRhDocSerializeStatus *  )

◆ RdkDocument()

const class CRhRdkDocument& CRhinoDoc::RdkDocument ( ) const

D E P R E C A T E D D O C U M E N T O B J E C T A C C E S S M E T H O D S

These methods are deprecated in favor of using the document's render settings. The new way to use this is to call CRhinoDoc::Properties().RenderSettings() to get a reference to a const ON_3dmRenderSettings object. You can then call one of the following functions depending on what you're trying to do:

When reading, you can simply call the desired access method and then one of its const methods, for example:

const auto& rs = doc->Properties().RenderSettings(); const auto latitude = rs.Sun().Latitude(); ///< Call Sun() access method and then const method Latitude().

When you want to modify a value, you must first copy the render settings, modify the copy, and then set the copy back into the document. For example:

ON_3dmRenderSettings rs_write = rs; rs_write.Sun().SetLatitude(51.0); ///< Non-const method SetLatitude() must be called on the non-const copy. rs_write.Sun().SetLongitude(0.0); ///< Non-const method SetLongitude() must be called on the non-const copy. ... ///< You can change any number of other properties here. doc->Properties().SetRenderSettings(rs_write); ///< Commit the changes to the document.

For extensive examples of how to use these methods, see the samples repository at:

https://github.com/mcneel/rhino-developer-samples/blob/8/cpp/SampleCommands/cmdSampleRenderSettings.cpp

Deprecated:
Use Properties().RenderSettings() functions (Sun, Skylight etc. See comments above.

◆ Read3DM()

ON::ReadFileResult CRhinoDoc::Read3DM ( ON_BinaryArchive archive,
class CRhFileReadOptions &  fro3dm 
)

Description: Core Rhino code uses this this function to read 3dm archives. Remarks: Plug-ins cannot use this function because they cannot create CRhFileReadOptions classes. This is intentional.

◆ ReadFileOptions()

const class CRhFileReadOptions* CRhinoDoc::ReadFileOptions ( ) const

Returns: If a file is being read, this returns a pointer to a CRhFileReadOptions class that contains information about that file. If a file is not being read, this returns nullptr. Remarks: Plug-ins cannot use this function because they cannot create CRhFileReadOptions classes. This is intentional.

◆ ReadFileResult()

ON::ReadFileResult CRhinoDoc::ReadFileResult ( ) const

Returns: The value returned by the most recent call to Read3DM() or ReadPlugInFile().

◆ ReadFileVersion()

int CRhinoDoc::ReadFileVersion ( ) const

Description: Return file version extracted by CRhinoDoc::Read3DM(). Will not return values from referenced or merged files. Returns: Less than zero means no file has bee read otherwise 1 (V1.x), 2( V2.x) or 3 See Also: CRhinoDoc::Read3DM

◆ ReadingAncillaryModel()

bool CRhinoDoc::ReadingAncillaryModel ( unsigned int *  worksession_ref_model_sn,
const CRhinoInstanceDefinition **  idef,
ON_UUID grandparent_layer_id 
) const

Description: Determine if a reference model is currently being read and get information about what type of reference is being read. This information is sometimes required by file reading plug-ins.

Parameters: worksession_ref_model_sn - [out] If a work session reference model is currently being read, then the returned value of *worksession_ref_model_sn will be the non-zero work session reference model serial number. Otherwise the returned value of *worksession_ref_model_sn will be zero. Pass null if you do not want this information.

idef - [out] If an instance definition reference model is currently being read, then the returned value of idef will be non-null. When the Insert command is being used to create a block definition, this idef can be a static, linked and embedded, or linked idef. When an out-of-date block definition is being updated, this idef can be linked and embedded or linked. Pass null if you do not want this information.

grandparent_layer_id - [out] If a reference model is currently being read, then the returned value of *grandparent_layer_id will be the id of the grandparent layer for that reference model. Otherwise the returned value of grandparent_layer_id will be nil. Pass null if you do not want this information.

Returns: True if a reference file is currently being read.

Remarks: Worksession reference models can contain linked instance definitions and linked instance definitions can contain embedded instance definitions.

◆ ReadPlugInFile()

bool CRhinoDoc::ReadPlugInFile ( class CRhinoFileImportPlugIn import_plug_in,
int  file_extension_index,
class CRhFileReadOptions &  fro 
)

Description: Core Rhino code uses this this function to call file reading plug-ins to read files. Remarks: Plug-ins cannot use this function because they cannot create CRhFileReadOptions classes. This is intentional.

◆ RecreateRhinoViewHWnds()

static void CRhinoDoc::RecreateRhinoViewHWnds ( )
static

Description: Creates new window handles for every CRhinoView.

◆ Redo()

bool CRhinoDoc::Redo ( )

◆ RedoActive()

bool CRhinoDoc::RedoActive ( ) const

Returns: True if Redo() is currently active.

◆ Redraw() [1/2]

void CRhinoDoc::Redraw ( )

Description: Redraw all views of the active document. Remarks: If you change something in the active document – like adding objects, deleting objects, modifying layer or object display attributes, etc., then you need to call CRhinoDoc::Redraw to redraw all the views.

If you change something in a particular view like the projection, construction plane, background bitmap, etc., then you need to call CRhinoView::Redraw to redraw that particular view.

Calling CRhinoDoc::Redraw is conceptually like calling CDoc::UpdateAllViews() but Redraw is faster and draws the active view first.

NEVER CALL UpdateAllViews() IN RHINO.

See Also CRhinoView::SetRedrawDisplayHint CRhinoView::Redraw( unsigned int display_hint )

◆ Redraw() [2/2]

void CRhinoDoc::Redraw ( unsigned int  display_hint)

Description: Redraw all views of the active document with an explicit display hint. This version of Redraw is intended for expert users doing custom drawing.

Parameters: display_hint - [in] one of CRhinoView::regenerate_display_hint CRhinoView::mark_display_hint CRhinoView::refresh_display_hint Remarks: Calling CRhinoDoc::Redraw(display_hint) is the same as making the two calls SetRedrawDisplayHint( display_hint ) Redraw() If you do not know what display hint to use, the just call Redraw() and it will automatically use the appropriate type of redraw.

NEVER CALL UpdateAllViews() IN RHINO. See Also CRhinoView::Redraw() CRhinoView::SetRedrawDisplayHint

◆ RedrawAllDocs() [1/2]

static void CRhinoDoc::RedrawAllDocs ( )
static

Description: Calls "Redraw" for all active documents.

◆ RedrawAllDocs() [2/2]

static void CRhinoDoc::RedrawAllDocs ( unsigned int  display_hint)
static

◆ RedrawDoc()

static void CRhinoDoc::RedrawDoc ( unsigned int  rhino_doc_sn)
static

◆ RedrawViewHelper()

void CRhinoDoc::RedrawViewHelper ( CRhinoView view,
int  view_redraw_display_hint 
)

Description: Low level helper for CRhinoView::Redraw(). You should call CRhinoView::Redraw() instead of this function.

◆ Regen()

void CRhinoDoc::Regen ( )

Description: Redraw all views of the active document with display hint == regenerate_display_hint. Good for a complete cleanup of the screen after a command that did a bunch of temporary drawing finishes

Remarks: Same as CRhinoDoc::Redraw( CRhinoView::regenerate_display_hint).

CRhinoDoc::Regen can be MUCH SLOWER than calling CRhinoDoc:Redraw() and should be used sparingly. When developing a command, it is best to call Redraw() to see if it will do the trick, and then resort to Regen() if nothing else works. Most commands should not need to call Regen(). See Also CRhinoView::Redraw() CRhinoView::SetRedrawDisplayHint

◆ RemoveGrip()

void CRhinoDoc::RemoveGrip ( CRhinoGripObject grip)

◆ RemovePageView()

void CRhinoDoc::RemovePageView ( class CRhinoPageView pageView)

Description: Remove page view window from list of page views for this model. Parameters: pageView: [in] CRhinoPageView to be added

◆ RenderChannels()

const class IRhRdkRenderChannels& CRhinoDoc::RenderChannels ( ) const
Deprecated:
Use Properties().RenderSettings().RenderChannels() instead. See comments above.

◆ RepeatCommand()

void CRhinoDoc::RepeatCommand ( )

repeats previous command

◆ ReplaceModelViews()

void CRhinoDoc::ReplaceModelViews ( int  view_count,
const ON_3dmView views 
)

Description: Replace the standard rhino views with new rhino views based on a set of ON_3dmView objects. All other views are left unchanged (page and detail views are untouched). Parameters: view_count: [in] number of objects in views array views: [in] array of ON_3dmViews

◆ ReplaceObject() [1/11]

const CRhinoBrepObject* CRhinoDoc::ReplaceObject ( const CRhinoObjRef objref,
const ON_Brep brep 
)

Description: Replace one object with new brep object. Parameters: objref - [in] reference to old object to be replaced. The object objref.Object() will be deleted. brep - [in] new brep to be added. A duplicate of the brep is added to the Rhino model. If the brep parameter is on the heap, then the caller is responsible for deleting the brep parameter after the call. If this will be inefficient, use the version of ReplaceObject that takes a CRhinoObject* as the second argument. See Also: CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_3dPoint& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Curve& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Surface& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Brep& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Mesh& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, CRhinoObject* ); Returns: If successful, a pointer to the new CRhinoBrepObject is returned.

◆ ReplaceObject() [2/11]

const CRhinoCurveObject* CRhinoDoc::ReplaceObject ( const CRhinoObjRef objref,
const ON_Curve curve 
)

Description: Replace one object with new curve object. Parameters: objref - [in] reference to old object to be replaced. The object objref.Object() will be deleted. curve - [in] new curve to be added. A duplicate of the curve is added to the Rhino model. If the curve parameter is on the heap, then the caller is responsible for deleting the curve parameter after the call. If this will be inefficient, use the version of ReplaceObject that takes a CRhinoObject* as the second argument. Example:

ON_NurbsSurface nurbs_surface = ...; CRhinoObject* rhino_object = ...; ///< existing rhino object ReplaceObject( CRhinoObjRef( rhino_object ), nurbs_surface ); See Also: CRhinoDoc::ReplaceObject( const CRhinoObjRef&, ON_3dPoint ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Curve& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Surface& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Brep& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Mesh& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, CRhinoObject* ); Returns: If successful, a pointer to the new CRhinoCurveObject is returned.

◆ ReplaceObject() [3/11]

const CRhinoExtrusionObject* CRhinoDoc::ReplaceObject ( const CRhinoObjRef objref,
const ON_Extrusion extrusion 
)

Description: Replace one object with new extrusion object. Parameters: objref - [in] reference to old object to be replaced. The object objref.Object() will be deleted. brep - [in] new brep to be added. A duplicate of the extrusion is added to the Rhino model. If the extrusion parameter is on the heap, then the caller is responsible for deleting the extrusion parameter after the call. If this will be inefficient, use the version of ReplaceObject that takes a CRhinoObject* as the second argument. See Also: CRhinoDoc::ReplaceObject(const CRhinoObjRef&, const ON_3dPoint&); CRhinoDoc::ReplaceObject(const CRhinoObjRef&, const ON_Curve&); CRhinoDoc::ReplaceObject(const CRhinoObjRef&, const ON_Surface&); CRhinoDoc::ReplaceObject(const CRhinoObjRef&, const ON_Brep&); CRhinoDoc::ReplaceObject(const CRhinoObjRef&, const ON_Mesh&); CRhinoDoc::ReplaceObject(const CRhinoObjRef&, CRhinoObject*); Returns: If successful, a pointer to the new CRhinoExtrusionObject is returned.

◆ ReplaceObject() [4/11]

const CRhinoObject* CRhinoDoc::ReplaceObject ( const CRhinoObjRef objref,
const ON_Geometry geometry,
bool  bIgnoreModes 
)

Description: Replace the geometry in one object. Parameters: objref - [in] reference to old object to be replaced. The object objref.Object() will be deleted. geometry - [in] new geometry to be added. A duplicate of the geometry is added to the Rhino model. If the geometry parameter is on the heap, then the caller is responsible for deleting the mesh parameter after the call. If this will be inefficient, use the version of ReplaceObject that takes a CRhinoObject* as the second argument. bIgnoreModes - [in] If true, locked and hidden objects are replaced. If false objects that are locked, hidden, or on locked or hidden layers are not replaced. Returns: If successful, a pointer to the new CRhinoObject is returned.

◆ ReplaceObject() [5/11]

const CRhinoMeshObject* CRhinoDoc::ReplaceObject ( const CRhinoObjRef objref,
const ON_Mesh mesh 
)

Description: Replace one object with new mesh object. Parameters: objref - [in] reference to old object to be replaced. The object objref.Object() will be deleted. mesh - [in] new mesh to be added. A duplicate of the mesh is added to the Rhino model. If the mesh parameter is on the heap, then the caller is responsible for deleting the mesh parameter after the call. If this will be inefficient, use the version of ReplaceObject that takes a CRhinoObject* as the second argument. See Also: CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_3dPoint& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Curve& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Surface& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Brep& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Mesh& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, CRhinoObject* ); Returns: If successful, a pointer to the new CRhinoMeshObject is returned.

◆ ReplaceObject() [6/11]

const CRhinoSubDObject* CRhinoDoc::ReplaceObject ( const CRhinoObjRef objref,
const ON_SubD subd 
)

Description: Replace one object with a new SubD object. Parameters: objref - [in] reference to old object to be replaced. The object objref.Object() will be deleted. subd - [in] new SubD to be added. A duplicate of the SubD is added to the Rhino model. If the SubD parameter is on the heap, then the caller is responsible for deleting the mesh parameter after the call. If this will be inefficient, use the version of ReplaceObject that takes an ON_SubDRef as the 2nd argument. Returns: If successful, a pointer to the new CRhinoSubDObject is returned.

◆ ReplaceObject() [7/11]

const CRhinoSurfaceObject* CRhinoDoc::ReplaceObject ( const CRhinoObjRef objref,
const ON_Surface surface 
)

Description: Replace one object with new surface object. Parameters: objref - [in] reference to old object to be replaced. The object objref.Object() will be deleted. surface - [in] new surface to be added. A duplicate of the surface is added to the Rhino model. If the surface parameter is on the heap, then the caller is responsible for deleting the surface parameter after the call. If this will be inefficient, use the version of ReplaceObject that takes a CRhinoObject* as the second argument. Example:

ON_NurbsSurface nurbs_surface = ...; CRhinoObject* rhino_object = ...; ///< existing rhino object ReplaceObject( CRhinoObjRef( rhino_object ), nurbs_surface ); See Also: CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_3dPoint& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Curve& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Surface& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Brep& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Mesh& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, CRhinoObject* ); Returns: If successful, a pointer to the new CRhinoSurfaceObject is returned.

◆ ReplaceObject() [8/11]

bool CRhinoDoc::ReplaceObject ( const CRhinoObjRef objref,
CRhinoObject new_object,
bool  bIgnoreModes,
bool  bSkipInCommandTest 
)

◆ ReplaceObject() [9/11]

bool CRhinoDoc::ReplaceObject ( const CRhinoObjRef objref,
CRhinoObject new_object,
bool  bIgnoreModes = false 
)

Description: Replace one object with another. Conceptually, this function is the same as calling

Setting new_object attributes = old_object attributes DeleteObject(old_object); AddObject(old_object);

Parameters: objref - [in] reference to old object to be replaced. The object objref.Object() will be deleted. new_object - [in] new object to be activated - must not be in document. bIgnoreModes - [in] If true, locked and hidden objects are replaced. If false objects that are locked, hidden, or on locked or hidden layers are not replaced. bSkipInCommandTest - [in] In order for undo, history, event watcher expectations, and other important core processes to work correctly, ReplaceObject() must be run inside of a command. If it is not, as is common when modeless user interface code calls replace object, a "proxy" command is automatically run. In extremely rare cases, this is not desired. If you are an expert and you are certain that you want to run replace object outside of a command, then call ReplaceObject with bSkipInCommandTest = true. See Also: CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_3dPoint& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Curve& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Surface& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Brep& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Mesh& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, CRhinoObject* ); Returns: true if successful.

◆ ReplaceObject() [10/11]

const CRhinoPointObject* CRhinoDoc::ReplaceObject ( const CRhinoObjRef objref,
ON_3dPoint  point 
)

Description: Replace one object with new point object. Parameters: objref - [in] reference to old object to be replaced. The object objref.Object() will be deleted. point - [in] new point to be added. The point is copied. Example:

ON_NurbsSurface nurbs_surface = ...; CRhinoObject* rhino_object = ...; ///< existing rhino object ReplaceObject( CRhinoObjRef( rhino_object ), nurbs_surface ); See Also: CRhinoDoc::ReplaceObject( const CRhinoObjRef&, ON_3dPoint ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Curve& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Surface& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Brep& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, const ON_Mesh& ); CRhinoDoc::ReplaceObject( const CRhinoObjRef&, CRhinoObject* ); Returns: If successful, a pointer to the new CRhinoPointObject is returned.

◆ ReplaceObject() [11/11]

const CRhinoSubDObject* CRhinoDoc::ReplaceObject ( const CRhinoObjRef objref,
ON_SubDRef  subd_ref 
)

Description: Replace one object with a new SubD object. Parameters: objref - [in] reference to old object to be replaced. The object objref.Object() will be deleted. subd_ref - [in] new SubD to be added. The new object will reference the same subd as subd_ref. Returns: If successful, a pointer to the new CRhinoSubDObject is returned.

◆ ResetViewPipelines()

void CRhinoDoc::ResetViewPipelines ( void  )

Description: Resets all of the view pipelines to make sure they're all using the expected default pipeline (i.e. GetDefaultDisplayPipelineClass()). Certain situations arise where the pipeline class gets switched out to be something different than the default class...an example would be a shaded analysis mode getting set in a view that is currently using GDI wireframe...When the analysis mode is canceled, the view needs to return back to the GDI wireframe (i.e. the default display class). This routine simply ensures that all views are configured to their appropriate default display class.

Parameters: none

Remarks: The routine basically iterates through all views calling: CRhinoView::SetupDisplayPipeline()

◆ RestoreWaitCursor()

void CRhinoDoc::RestoreWaitCursor ( )

call after MessageBox

◆ RhinoFileReadInProgress()

bool CRhinoDoc::RhinoFileReadInProgress ( ) const

Returns: True if Rhino is actively reading a .3dm file.

◆ RunMenuScript()

bool CRhinoDoc::RunMenuScript ( const wchar_t *  s)

◆ RunMruCommand()

void CRhinoDoc::RunMruCommand ( int  cmd_index)

Description: Called by CMruCommandMenu::MruCmd() to run a m_mru_command_list command macro. Will move the macro from its current list position to top of display list. Parameters: cmd_index - [in] command macro to run

◆ RunMruFavoriteCommand()

void CRhinoDoc::RunMruFavoriteCommand ( int  cmd_index)

Description: Called by CMruCommandMenu::Favorite() to run a CRhinoAppGeneralSettings.m_popup_favorites macro. Will make sure command does not show up on the MRU list Parameters: cmd - [in] m_mru_command_list index of command to run

◆ RunningCommand()

const CRhinoCommand* CRhinoDoc::RunningCommand ( int  i) const

Description: When script running or nestable commands are running, there can be more than one command running at a given time. The private array m_running_commands_stack[] keeps track of all the commands that are running. The one on the end of the array is the "active" command. You really should not be using this function, except when you are forced to hack around a sticky situation that requires you to know when a certain command (like a base level script running command) may be active. Parameters: i - [in] 0 based index. Returns: Pointer to command.

◆ RunningCommandsStack()

const ON_SimpleArray<const CRhinoCommand*>& CRhinoDoc::RunningCommandsStack ( )

◆ RunScript() [1/2]

bool CRhinoDoc::RunScript ( const class CRhinoScriptContext script)

◆ RunScript() [2/2]

bool CRhinoDoc::RunScript ( const wchar_t *  script,
int  echo_mode = 1 
)

Description: Run a Rhino command script. Parameters: script - [in] script to run echo_mode - [in] Controls how the script is echoed in the command output window. 0 = silent - nothing is echoed 1 = verbatim - the script is echoed literally Remarks: Rhino acts as if each character in the script string had been typed in the command prompt. When RunScript is called from a "script runner" command, it completely runs the script before returning. When RunScript is called outside of a command, it returns and the script is run. This way menus and buttons can use RunScript to execute complicated functions.

◆ RunScriptEx()

bool CRhinoDoc::RunScriptEx ( const wchar_t *  script,
const wchar_t *  mruDisplayString,
int  echo_mode = 1 
)

Description: Run a Rhino command script. Parameters: script - [in] script to run mruDisplayString - [in] If this is a valid string then the macro is added to the MRU command list using this string, if it is NULL or an empty string then false is returned. echo_mode - [in] Controls how the script is echoed in the command output window. 0 = silent - nothing is echoed 1 = verbatim - the script is echoed literally Remarks: Rhino acts as if each character in the script string had been typed in the command prompt. When RunScript is called from a "script runner" command, it completely runs the script before returning. When RunScript is called outside of a command, it returns and the script is run. This way menus and buttons can use RunScript to execute complicated functions.

◆ RuntimeSerialNumber() [1/2]

unsigned int CRhinoDoc::RuntimeSerialNumber ( ) const

Description: The CRhinoDoc runtime serial number is a value >= 1 that and is unique for each instance of a CRhinoDoc class in a given instance of the Rhino.exe application. A value of 0 is unset and never identifies a document. The first CRhinoDoc created has serial number 1. The serial number can be used to identify find and identify documents and is a fast and robust way to specify a document (as opposed to passing around a CRhinoDoc pointer or reference). See Also: CRhinoDoc::FromSerialNumber(); Remarks:

◆ RuntimeSerialNumber() [2/2]

static unsigned int CRhinoDoc::RuntimeSerialNumber ( const CRhinoDoc rhino_doc)
static

Parameters: rhino_doc - [in] This parameter can be null, in which case zero is returned. Returns: The runtime serial number of the rhino_doc parameter. Remarks: This function is provided so that code doesn't have to check for a null pointer before calling the member function CRhinoDoc.RuntimeSerialNumber(). If the rhino_doc pointer is not null, this function returns rhino_doc->RuntimeSerialNumber().

◆ SafeFrame()

const class IRhRdkSafeFrame& CRhinoDoc::SafeFrame ( ) const
Deprecated:
Use Properties().RenderSettings().SafeFrame() instead. See comments above.

◆ SafeMFCDoc() [1/2]

CDocument* CRhinoDoc::SafeMFCDoc ( void  )

◆ SafeMFCDoc() [2/2]

const CDocument* CRhinoDoc::SafeMFCDoc ( void  ) const

◆ SaveAllModifiedDocuments() [1/2]

static bool CRhinoDoc::SaveAllModifiedDocuments ( )
static

Description: Calls CRhinoDoc.SaveModified() for every existing document. Returns: If the user answers "cancel" to any of the queries, then false is returned. Otherwise true is returned.

◆ SaveAllModifiedDocuments() [2/2]

static bool CRhinoDoc::SaveAllModifiedDocuments ( bool  bUseBatchMode)
static

Description: Calls CRhinoDoc.SaveModified() for every existing document. If the user answers "cancel" to any of the queries, then false is returned. Otherwise true is returned. Parameters: bUseBatchMode - [in] Use true to suppress dialog boxes. Returns: If the user answers "cancel" to any of the queries, then false is returned. Otherwise true is returned.

◆ SaveDocument()

bool CRhinoDoc::SaveDocument ( bool  bUseBatchMode)

Description: This is the function that is used to "save" the document. If this function does not work for you, then call CRhinoDoc::WriteFile(). Parameters: bUseBatchMode - [in] Returns: True: Success. False: Failure.

◆ SaveModified() [1/2]

bool CRhinoDoc::SaveModified ( bool  bUseBatchMode)

◆ SaveModified() [2/2]

BOOL32 CRhinoDoc::SaveModified ( void  )

◆ ScaleObjects()

int CRhinoDoc::ScaleObjects ( CRhinoObjectIterator it,
double  scale,
bool  bDeleteOriginal,
bool  bAddTransformHistory,
bool  bTransformReferenceObjects 
)

Description: Creates a new object that is a scaled version of the input object and deletes the existing object if bDeleteOriginal is true.

Scale all objects in the iterator around world origin

This is called for unit changes and in addition to scaling geometry, it may change some attributes. As of Sept 14, 2017, it will scale hatch patterns of hatch objects

◆ SerializeStatus()

class CRhDocSerializeStatus* CRhinoDoc::SerializeStatus ( ) const

Description: The MFC framework does not provide a good way for options to be passed into the CDocument virtual functions like Serialize, SaveAs, DoSave, ...

◆ SetActiveRhinoViewSerialNumber()

bool CRhinoDoc::SetActiveRhinoViewSerialNumber ( unsigned int  new_active_rhino_view_sn)

Parameters: new_active_rhino_view_sn - [in] The runtime serial number of a CRhinoView for this document. Returns: True if the input parameter was valid and the document's active view was set.

◆ SetAutoDelete()

void CRhinoDoc::SetAutoDelete ( BOOL32  bAutoDelete)

◆ SetCommandToRepeat()

void CRhinoDoc::SetCommandToRepeat ( const CRhinoApp::CRhMruCommandRecord rec)

◆ SetModelName() [1/2]

void CRhinoDoc::SetModelName ( const char *  )

◆ SetModelName() [2/2]

void CRhinoDoc::SetModelName ( const wchar_t *  )

◆ SetModifiedFlag()

void CRhinoDoc::SetModifiedFlag ( BOOL32  bModified = TRUE)

◆ SetMruMenuString()

void CRhinoDoc::SetMruMenuString ( LPCTSTR  str)

◆ SetPageViewNumber()

void CRhinoDoc::SetPageViewNumber ( class CRhinoPageView pageView,
int  page 
)

Description: Set page number of a page view window for this model. Parameters: pageView: [in] CRhinoPageView to be changed page: [in] new page number for pageView

◆ SetPathName()

void CRhinoDoc::SetPathName ( LPCTSTR  ,
BOOL32  bAddToMRU = TRUE 
)

◆ SetReadFileResult()

void CRhinoDoc::SetReadFileResult ( ON::ReadFileResult  read_file_result)

Description: Set the value returned by ReadFileResult() to CRhinoDoc::eReadFileResult::Unset. Typically this happens after Rhino has handled the read in whatever way is appropriate.

◆ SetRedrawDisplayHint()

void CRhinoDoc::SetRedrawDisplayHint ( unsigned int  display_hint,
bool  bShadedOnly = false 
) const

Description: Expert user tool to set flags used by CRhinoDoc::Redraw(). Parameters: display_hint - [in] one of CRhinoView::regenerate_display_hint CRhinoView::mark_display_hint CRhinoView::refresh_display_hint dm - [in] If the display hint only applies to a certain display mode, set dm to that mode. Otherwise the display hint will be applied to all views.

◆ SetSubDAppearance()

unsigned int CRhinoDoc::SetSubDAppearance ( ON_SubDComponentLocation  subd_appearance)

Parameters: subd_appearance - [in] ON_SubDComponentLocation::Surface - SubD display will be smooth shaded surfaces. ON_SubDComponentLocation::ControlNet - SubD display will be flat shaded control polygons. Returns: Number of subds whose appearance changed. Remarks: SubDAppearance() is a runtime property. It is not saved in 3dm files.

◆ SetTitle()

void CRhinoDoc::SetTitle ( LPCTSTR  )

◆ SetUserString()

bool CRhinoDoc::SetUserString ( const wchar_t *  key,
const wchar_t *  string_value 
)

user key-value string pairs on the document Description: Attach a user string to the document. Parameters: key - [in] id used to retrieve this string. string_value - [in] If NULL, the string with this id will be removed. Returns: True if successful.

◆ ShowObject()

bool CRhinoDoc::ShowObject ( const CRhinoObjRef objref,
bool  bIgnoreLayerMode = false 
)

shows hidden object

Description: If objref.Object()->IsHidden() is true, then the object will be returned to normal (visible and selectable) mode. Parameters: objref - [in] reference to normal object to show bIgnoreLayerMode - [in] if true, the object will be shown even if it is on a layer that is locked or off. Returns: true if the object was successfully shown. See Also: CRhinoDoc::HideObject

◆ Skylight()

const class IRhRdkSkylight& CRhinoDoc::Skylight ( ) const
Deprecated:
Use Properties().RenderSettings().Skylight() instead. See comments above.

◆ SnapTo()

BOOL32 CRhinoDoc::SnapTo ( const CRhinoSnapContext snap_context,
CRhinoSnapEvent snap_event,
const ON_SimpleArray< ON_3dPoint > *  construction_points = 0,
const ON_SimpleArray< ON_3dPoint > *  snap_points = 0,
const ON_SimpleArray< ON_3dPoint > *  int_snap_points = 0 
) const

Description: Object snapping tool. Parameters: snap_context - [in] snap_event - [out] If SnapTo returns true, then the type and location of the snap is returned in snap_event. construction_points - [in] optional array of points that will be snapped to independent of current point osnap settings. snap_points - [in] optional array of points that will be snapped to if point osnap is enabled. int_snap_points - [in] optional array of points that will be snapped to if int osnap is enabled. Used for snapping to isocurve intersections when input is constrained to a brep or brep face. Returns: true if a snap occurred.

◆ SortedPageViewList()

const ON_SimpleArray<class CRhinoPageView*>& CRhinoDoc::SortedPageViewList ( )

Description: Returns sorted list of all the page views in this model. The sort order can be considered the page number order

◆ StatusBarProgressMeterEnd()

void CRhinoDoc::StatusBarProgressMeterEnd ( )

Description: Ends, or hides, Rhino's status bar progress meter. See Also: CRhinoDoc::StatusBarProgressMeterStart CRhinoDoc::StatusBarProgressMeterPos

◆ StatusBarProgressMeterPos() [1/2]

int CRhinoDoc::StatusBarProgressMeterPos ( const wchar_t *  pszLabel,
int  nPos,
bool  bAbsolute 
)

Description: Sets the current position of Rhino's status bar progress meter. Parameters: pszLabel - [in] The short description of the progress (e.g. "Calculating", "Meshing", etc). nPos - [in] The position. If ON_UNSET_INT_INDEX, then only the label will be updated. bAbsolute - [in] If true, then the progress meter is moved to nPos (absolute). If false, then the progress meter is moved nPos from the current position (relative). Returns: The previous position if successful. See Also: CRhinoDoc::StatusBarProgressMeterStart CRhinoDoc::StatusBarProgressMeterEnd

◆ StatusBarProgressMeterPos() [2/2]

int CRhinoDoc::StatusBarProgressMeterPos ( int  nPos,
bool  bAbsolute = true 
)

Description: Sets the current position of Rhino's status bar progress meter. Parameters: nPos - [in] The position. bAbsolute - [in] If true, then the progress meter is moved to nPos (absolute). If false, then the progress meter is moved nPos from the current position (relative). Returns: The previous position if successful. See Also: CRhinoDoc::StatusBarProgressMeterStart CRhinoDoc::StatusBarProgressMeterEnd

◆ StatusBarProgressMeterStart()

int CRhinoDoc::StatusBarProgressMeterStart ( int  nLower,
int  nUpper,
const wchar_t *  pszLabel = nullptr,
bool  bEmbedLabel = true,
bool  bShowPercent = true 
)

Description: Starts, or shows, Rhino's status bar progress meter. Parameters: nLower - [in] The lower limit of the progress meter's range. nUpper - [in] The upper limit of the progress meter's range. pszLabel - [in] The short description of the progress (e.g. "Calculating", "Meshing", etc). bEmbedLabel - [in] If true, then the label will be embedded in the progress meter. If false, then the label will appear to the left of the progress meter. bShowPercent - [in] If true, then the percent complete will appear in the progress meter. Returns: 1 - The progress meter was created successfully. 0 - The progress meter was not created. -1 - The progress meter was not created because some other process has already created it. See Also: CRhinoDoc::StatusBarProgressMeterPos CRhinoDoc::StatusBarProgressMeterEnd

◆ SubDAppearance()

ON_SubDComponentLocation CRhinoDoc::SubDAppearance ( ) const

Returns: ON_SubDComponentLocation::Surface - SubD display will be smooth shaded surfaces. ON_SubDComponentLocation::ControlNet - SubD display will be flat shaded control polygons. Remarks: SubDAppearance() is a runtime property. It is not saved in 3dm files.

◆ Sun()

const class IRhRdkSun& CRhinoDoc::Sun ( ) const
Deprecated:
Use Properties().RenderSettings().Sun() instead. See comments above.

◆ Table()

const CRhinoDocTableReference& CRhinoDoc::Table ( ON_ModelComponent::Type  component_type) const

◆ TailRuntimeSerialNumber()

static unsigned int CRhinoDoc::TailRuntimeSerialNumber ( )
static

Returns: The serial number of the newest document that exists or 0 if no documents exist. This will be the largest serial number of any document that currently exits. Remarks: Other documents may have been created and deleted after this document.

◆ TargetDocSerialNumber()

static unsigned int CRhinoDoc::TargetDocSerialNumber ( )
static

Returns: The runtime serial number of the document a command will use if a specific document is not otherwise specified. Remarks:

  • It is rare that this function is required and it should be called sparingly. Never use this function when you are in a command, instead use the doc passed in the command's context parameter.
  • The doc for a command context, the "target" doc, and the "modeless user interface" doc can be three different documents.
  • The core Rhino application decides what document is used here. There is no way for a plug-in to change this value and that is intentional.

◆ TemplateFileUsed()

const wchar_t* CRhinoDoc::TemplateFileUsed ( ) const

Description: Call this method to get the name of the template file used to create this document. This is a runtime value only present if the document was newly created. Returns: Returns full path to template used to create this document on File/New

◆ TextureReport()

virtual TextureReportResult CRhinoDoc::TextureReport ( TextureReportFilter  initialFilter,
bool  bAllowAbort,
bool  bForceDisplayIfEmpty 
)
virtual

◆ ThreeViewLayout() [1/2]

void CRhinoDoc::ThreeViewLayout ( bool  bUseMatchingViews = false)

◆ ThreeViewLayout() [2/2]

void CRhinoDoc::ThreeViewLayout ( ON_BoundingBox  model_bbox,
bool  bUseMatchingViews = false 
)

◆ TransformObject() [1/3]

CRhinoObject* CRhinoDoc::TransformObject ( const CRhinoObject old_object,
const ON_Xform xform,
bool  bAddNewObjectToDoc,
bool  bDeleteOriginal,
bool  bAddTransformHistory 
)

Description: Creates a new object that is the transformation of the existing object and deletes the existing object if bDeleteOriginal is true.

Parameters: old_object - [in] reference to object to morph. The object objref.Object() will be deleted if bDeleteOriginal is true. xform - [in] transformation to apply bAddNewObjectToDoc - [in] if true, the new object is added to the document. if false, the new object is not added to the document. bDeleteOriginal - [in] if true, the original object is deleted if false, the original object is not deleted bAddTransformHistory - [in] If true and history recording is turned on, then transformation history is recorded. This will be adequate for simple transformation commands like rotate, move, scale, and so on that do not have auxiliary input objects. For fancier commands, that have an auxiliary object, like the spine curve in ArrayAlongCrv, set bAddTransformHistory to false. Returns: New object that is the morph of the existing_object. The new object has identical attributes.

Remarks: If the object is locked or on a locked layer, then it cannot be transformed.

◆ TransformObject() [2/3]

CRhinoObject* CRhinoDoc::TransformObject ( const CRhinoObject old_object,
const ON_Xform xform,
bool  bAddNewObjectToDoc,
bool  bDeleteOriginal,
bool  bAddTransformHistory,
bool  bTransformReferenceObjects,
ON_2dexMap pGroupMap = 0 
)

Description: Creates a new object that is the transformation of the existing object and deletes the existing object if bDeleteOriginal is true.

Parameters: old_object - [in] reference to object to morph. The object objref.Object() will be deleted if bDeleteOriginal is true. xform - [in] transformation to apply bAddNewObjectToDoc - [in] if true, the new object is added to the document. if false, the new object is not added to the document. bDeleteOriginal - [in] if true, the original object is deleted if false, the original object is not deleted bAddTransformHistory - [in] If true and history recording is turned on, then transformation history is recorded. This will be adequate for simple transformation commands like rotate, move, scale, and so on that do not have auxiliary input objects. For fancier commands, that have an auxiliary object, like the spine curve in ArrayAlongCrv, set bAddTransformHistory to false. bTransformReferenceObjects - [in] If true reference objects are allowed to be transformed. pGroupMap - [in/out] Optional group map if copy transforming multiple grouped objects, and the new objects should be grouped with other copies and not the originals.

Returns: New object that is the morph of the existing_object. The new object has identical attributes.

Remarks: If the object is locked or on a locked layer, then it cannot be transformed.

◆ TransformObject() [3/3]

CRhinoObject* CRhinoDoc::TransformObject ( CRhinoObjRef objref,
const ON_Xform xform,
bool  bDeleteOriginal = true,
bool  bIgnoreModes = false,
bool  bAddTransformHistory = false 
)

Description: Creates a new object that is the transformation of the existing object and deletes the existing object if bDeleteOriginal is true.

Parameters: objref - [in] reference to object to transform. The object objref.Object() will be deleted if bDeleteOriginal is true. xform - [in] transformation to apply bDeleteOriginal = [in] if true, the original object is deleted if false, the original object is not deleted bIgnoreModes - [in] If true, locked and hidden objects are transformed. If false objects that are locked, hidden, or on locked or hidden layers are not transformed. bAddTransformHistory - [in] If true and history recording is turned on, then transformation history is recorded. This will be adequate for simple transformation commands like rotate, move, scale, and so on that do not have auxiliary input objects. For fancier commands, that have an auxiliary object, like the spine curve in ArrayAlongCrv, set bAddTransformHistory to false. Returns: New object that is the transformation of the existing_object. The new object has identical attributes.

Remarks: If the object is locked or on a locked layer, then it cannot be transformed.

◆ TransformObjects() [1/2]

int CRhinoDoc::TransformObjects ( CRhinoObjectIterator it,
const ON_Xform xform,
bool  bDeleteOriginal,
bool  bIgnoreModes,
bool  bAddTransformHistory,
bool  bTransformReferenceObjects 
)

As of Sept 14, 2017, This is not used by rhino.

Parameters
bIgnoreModes(unused)

◆ TransformObjects() [2/2]

int CRhinoDoc::TransformObjects ( CRhinoObjectIterator it,
const ON_Xform xform,
bool  bDeleteOriginal = true,
bool  bIgnoreModes = false,
bool  bAddTransformHistory = false 
)

As of Sept 14, 2017, This is not used by rhino.

Description: Transforms every object in a list.

Parameters: it - [in] iterates through list of objects to transform xform - [in] transformation to apply bDeleteOriginal = [in] if true, the original objects are deleted if false, the original objects are not deleted bIgnoreModes - [in] (Parameter is unused and does nothing) If true, locked and hidden objects are transformed. If false objects that are locked, hidden, or on locked or hidden layers are not transformed. bAddTransformHistory - [in] If true and history recording is turned on, then transformation history is recorded. This will be adequate for simple transformation commands like rotate, move, scale, and so on that do not have auxiliary input objects. For fancier commands, that have an auxiliary object, like the spine curve in ArrayAlongCrv, set bAddTransformHistory to false. Returns: Number of objects that were transformed.

Remarks: This is similar to calling TransformObject() for each object int the list except that this function will modify locked and hidden objects. It is used for things like scaling the entire model when a unit system is changed.

◆ UndeleteObject()

bool CRhinoDoc::UndeleteObject ( const CRhinoObject object)

Description: If object->IsDeleted() is true, then the object is undeleted.

◆ Undo()

bool CRhinoDoc::Undo ( class CRhUndoRecord *  = NULL)

◆ UndoActive()

bool CRhinoDoc::UndoActive ( ) const

Returns: True if Undo() is currently active.

◆ UndoRecordCount()

int CRhinoDoc::UndoRecordCount ( ) const

Returns: Number of undo records.

◆ UndoRecordingIsActive()

bool CRhinoDoc::UndoRecordingIsActive ( ) const

true if actually happening now

◆ UndoRecordingIsEnabled()

bool CRhinoDoc::UndoRecordingIsEnabled ( ) const

true if permitted

◆ UndoRecordMemorySize()

size_t CRhinoDoc::UndoRecordMemorySize ( ) const

Returns: Number bytes in used by undo records

◆ UnitSystem()

ON::LengthUnitSystem CRhinoDoc::UnitSystem ( ) const

OBSOLETE - USE ModelUnits or PageUnits.

Returns: Model space unit system. Remarks: Use DocProperties().PageUnitsAndTolerances() for page space.

◆ UnlockObject()

bool CRhinoDoc::UnlockObject ( const CRhinoObjRef objref,
bool  bIgnoreLayerMode = false 
)

unlocks locked object

Description: If objref.Object()->IsLocked() is true, then the object will be returned to normal (visible and selectable) mode. Parameters: objref - [in] reference to locked object to unlock bIgnoreLayerMode - [in] if true, the object will be unlocked even if it is on a layer that is locked or off. Returns: true if the object was successfully unlocked. See Also: CRhinoDoc::HideObject

◆ UnselectAll()

int CRhinoDoc::UnselectAll ( BOOL32  bIgnorePersistentSelections = false)

Description: Unselect objects. Parameters: bIgnorePersistentSelections - [in] if true, then objects that are persistently selected will not be unselected. Returns: Number of object that were unselected. See Also: CRhinoObject::Select CRhinoObject::IsSelected

◆ UpdateAllViews()

void CRhinoDoc::UpdateAllViews ( CView *  pSender,
LPARAM  lHint = 0L,
CObject *  pHint = NULL 
)

Description: Pipes calls made to CRhinoDoc->UpdateAllViews() to CRhinoDoc::Redraw(). Developers are not supposed to use UpdateAllViews, but sometimes MFC die hards can't help themselves. Parameters: pSender - [in] (can be NULL) lHint - [in] passed to CRhinoDoc::SetRedrawDisplayHint() before CRhinoDoc::Redraw() is called. pHint - [in] ignored Remarks: UpdateAllViews is not a virtual function on CDoc. So, if somebody calls UpdateAllViews from a CDocument pointer, then we can' do anything about it. The views will eventually get drawn, they just won't get drawn in the right order and the snappy Rhino look-n-feel will be missing. See Also: CRhinoDoc::Redraw

◆ UserDataTable()

class CRhAnonymousUserTable* CRhinoDoc::UserDataTable ( void  )

◆ ValidateNewObjects()

bool CRhinoDoc::ValidateNewObjects ( ) const

Returns: True if CRhinoDoc::AddObject() is validating each object as it is added. This can be time consuming but is valuable for debugging.

◆ ViewFromViewportId()

const CRhinoView* CRhinoDoc::ViewFromViewportId ( ON_UUID  viewport_id) const

◆ ViewModified()

void CRhinoDoc::ViewModified ( CRhinoView )

Description: If you change a view, then call ViewModified. Parameters: view - [in] view that was modified.

◆ Write3dmFile() [1/2]

bool CRhinoDoc::Write3dmFile ( ON_BinaryArchive binary_archive,
CRhinoFileWriteOptions  fwo_in 
)

Description: Write active objects in the current document to an Rhino 3dm file. Parameters: binary_archive - [in] archive to write to fwo_in - [in] file writing options. fwo_out - [out] Complete file writing options that were used and additional status information. Returns: True: Write succeeded. See fwo_out for detailed information about the options that were used. False: Write failed. See fwo_out for detailed information about the failure.

◆ Write3dmFile() [2/2]

bool CRhinoDoc::Write3dmFile ( ON_BinaryArchive binary_archive,
CRhinoFileWriteOptions  fwo_in,
CRhinoFileWriteOptions fwo_out 
)

◆ WriteFile() [1/2]

bool CRhinoDoc::WriteFile ( CRhinoFileWriteOptions  fwo_in)

Description: Write information in this model to a file. Parameters: fwo - [in] file writing options fwo_out - [out] When you need to know the actual file writing options that were used, then call the version with an fwo_out parameter. The exact details about what options were used and the file writing status information is returned here. Returns: True: File writing succeeded. False: File writing failed. Example:

/ Get filename and export options. CRhinoFileWriteOptions fwo;

/ Get file name: doc.WriteFilePathAndOptionsDialog(fwo,false,fwo);

/ Write file doc.WriteFile(fwo,fwo);

/ Simple way to write a myFileName.3dm file. CRhinoFileWriteOptions fwo; fwo.SetFileName("myFileName.3dm"); doc.WriteFile(fwo);

Remarks: This is the best choice for general file writing. It handles making backups using temporary files, locking and unlocking, loading file writing plug-ins, and many other details.

◆ WriteFile() [2/2]

bool CRhinoDoc::WriteFile ( CRhinoFileWriteOptions  fwo_in,
CRhinoFileWriteOptions fwo_out 
)

◆ WriteFileInProgress()

const class CRhinoFileWriteOptions* CRhinoDoc::WriteFileInProgress ( ) const

File Writing Returns: If the document is being saved by CRhinoDoc::WriteFile(), then a pointer to the current file writing options is returned. Otherwise, null is returned. Remarks: Never save the returned pointer. If you need to reference the information later, make a copy. File writing plug-ins can use this information to determine what should be saved.

◆ WriteFilePathAndOptionsDialog()

bool CRhinoDoc::WriteFilePathAndOptionsDialog ( CRhinoFileWriteOptions  fwo_in,
unsigned int  minimum_rhino_3dm_version_rescrition,
CRhinoFileWriteOptions fwo_out,
HWND  pWndParent = 0 
) const

Description: Ask the user for a file name and additional file writing options. The document's default path and current title will be used to create a default file name. Parameters: fwo_in - [in] Current options that determine how the query is performed.

  • fwo_in.UseBatchMode() true: the query will use the Rhino command line interface. false: the query will use a dialog.
  • fwo_in.SelectedObjectFilter() true: The export interface will be used. false: The save interface will be used.
  • fwo_in.TemplateFileIsDestination() true: The template file interface will be used. false: The model file interface will be used.
  • fwo_in.GetFileName() Default file name. If not set, document's default path and current title will be used to create a default file name. minimum_rhino_3dm_version_rescrition - [in] 0: Any type of 3dm file or plug-in file format can be specified. >0: Only Rhino .3dm files with version >= minimum_rhino_3dm_version_rescrition can be specified. fwo_out - [out] File writing options including file name and other writing options the user may have set or changed. pWndParent - [in] Expert users can set a parent window. In general, leave this parameter set to zero and the Rhino mainframe will automatically be the parent. Example: CRhinoFileWriteOption fwo; fwo.Set...() ///< stuff you want to set up before the dialog is shown. if ( doc.WriteFilePathAndOptionsDialog(fwo,true or false,fwo) && doc.WriteFile(fwo,&fwo) ) { ON_wString filename; fwo.GetFileName(filename); Print("Model successfully saved in a file called %s\n",filename); } Returns: True: The file name and other file writing options are returned in fwo_out. False: The user did not select a file name or other failure.

Friends And Related Function Documentation

◆ C_EW_Manager

friend class C_EW_Manager
friend

◆ CRhDoc

friend class CRhDoc
friend

◆ CRhinoApp

friend class CRhinoApp
friend

◆ CRhinoFileMenu

friend class CRhinoFileMenu
friend

◆ CRhinoInstanceDefinitionTable

friend class CRhinoInstanceDefinitionTable
friend

◆ CRhinoLayerTable

friend class CRhinoLayerTable
friend

◆ CRhinoObjectIterator

friend class CRhinoObjectIterator
friend

◆ CRhinoRead3dmHelper

friend class CRhinoRead3dmHelper
friend

◆ CRhPushPopDocStatus

friend class CRhPushPopDocStatus
friend

◆ RhinoMemoryErrorHandler

int RhinoMemoryErrorHandler ( int  )
friend

SDK classes.

Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. Rhinoceros is a registered trademark 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 Rhino SDK copyright information see http://www.rhino3d.com/developer.

◆ RhSetTemplateFileUsed

void RhSetTemplateFileUsed ( CRhinoDoc ,
const wchar_t *   
)
friend

Member Data Documentation

◆ m__doc_sdk_extension

class CRhDocSdkExtension* CRhinoDoc::m__doc_sdk_extension

◆ m__idef_update

class CRhIDefUpdate* CRhinoDoc::m__idef_update

runtime information used when updating linked instance definitions

◆ m_bitmap_table

CRhinoBitmapTable CRhinoDoc::m_bitmap_table

bitmaps used in textures, backgrounds, wallpapers, ...

◆ m_dimstyle_table

CRhinoDimStyleTable CRhinoDoc::m_dimstyle_table

dimension styles used in annotation objects

◆ m_group_table

CRhinoGroupTable CRhinoDoc::m_group_table

groups

◆ m_hatchpattern_table

CRhinoHatchPatternTable CRhinoDoc::m_hatchpattern_table

hatch patterns used to fill hatch objects

◆ m_history_record_table

CRhinoHistoryRecordTable CRhinoDoc::m_history_record_table

instance definitions (blocks for you AutoCAD types)

◆ m_instance_definition_table

CRhinoInstanceDefinitionTable CRhinoDoc::m_instance_definition_table

instance definitions (blocks for you AutoCAD types)

◆ m_layer_table

CRhinoLayerTable CRhinoDoc::m_layer_table

layers

◆ m_light_table

CRhinoLightTable CRhinoDoc::m_light_table

rendering lights

◆ m_linetype_table

CRhinoLinetypeTable CRhinoDoc::m_linetype_table

linetypes

◆ m_material_table

CRhinoMaterialTable CRhinoDoc::m_material_table

rendering materials

◆ m_selset_manager

class CRhSelSetManager* CRhinoDoc::m_selset_manager

If the command name starts with an underscore "_", then the English names are searched, otherwise the aliases and localized names are searched. CRhCommandManager* m_command_manager;

◆ m_texture_mapping_table

CRhinoTextureMappingTable CRhinoDoc::m_texture_mapping_table

texture mappings

◆ NullRuntimeSerialNumber

const unsigned int CRhinoDoc::NullRuntimeSerialNumber
static

Returns: The value that will always return NULL when passed to CRhinoDoc::FromRuntimeSerialNumber. Remarks: This can be passed to functions that take a document runtime serial number to mean "no document".