Beispiel #1
0
 internal CurrentContentChangedEventArgs(RenderContent content, RenderContentKind kind)
   : base(content)
 { m_kind = kind; }
Beispiel #2
0
 public bool ChangeChild(RenderContent oldContent, RenderContent newContent)
 {
   if (null == oldContent)
     return false;
   IntPtr pThis = NonConstPointer();
   IntPtr pOld = oldContent.ConstPointer();
   IntPtr pNew = null == newContent ? IntPtr.Zero : oldContent.NonConstPointer();
   bool success = UnsafeNativeMethods.Rdk_RenderContent_ChangeChild(pThis, pOld, pNew);
   // If successfully added to the child content list then make sure the newContent
   // pointer does not get deleted when the managed object is disposed of since the
   // content is now included in this objects child content list
   if (success && null != newContent)
     newContent.m_bAutoDelete = false;
   return success;
 }
Beispiel #3
0
 internal ContentChangedEventArgs(RenderContent content, RenderContent.ChangeContexts cc)
   : base(content)
 { m_cc = cc; }
Beispiel #4
0
    // hiding until I understand what this does
    /// <summary>
    /// Implement this to transfer data from another content to this content during creation.
    /// </summary>
    /// <param name="oldContent">An old content object from which the implementation may harvest data.</param>
    /// <returns>The harvested result.</returns>
    /*public virtual*/ HarvestedResult HarvestData(RenderContent oldContent)
    {
      if (IsNativeWrapper())
        return (HarvestedResult)UnsafeNativeMethods.Rdk_RenderContent_HarvestData(ConstPointer(), oldContent.ConstPointer());

      return (HarvestedResult)UnsafeNativeMethods.Rdk_RenderContent_CallHarvestDataBase(ConstPointer(), oldContent.ConstPointer());
    }
Beispiel #5
0
 public bool AddChild(RenderContent renderContent)
 {
   IntPtr pThis = NonConstPointer();
   IntPtr pChild = null == renderContent ? IntPtr.Zero : renderContent.NonConstPointer();
   bool success = UnsafeNativeMethods.Rdk_RenderContent_AddChild(pThis, pChild);
   // If successfully added to the child content list then make sure the newContent
   // pointer does not get deleted when the managed object is disposed of since the
   // content is now included in this objects child content list
   if (success && null != renderContent)
     renderContent.m_bAutoDelete = false;
   return success;
 }
Beispiel #6
0
 /// <summary>
 /// Constructs a new content of the specified type and add it to the persistent content list.
 /// This function cannot be used to create temporary content that you delete after use.
 /// Content created by this function is owned by RDK and appears in the content editor.
 /// To create a temporary content which is owned by you, call RhRdkContentFactories().NewContentFromType().
 /// </summary>
 /// <param name="type">is the type of the content to add.</param>
 /// <param name="parent">Parent is the parent content. If not NULL, this must be an RDK-owned content that is
 /// in the persistent content list (either top-level or child). The new content then becomes its child.
 /// If NULL, the new content is added to the top-level content list instead.</param>
 /// <param name="childSlotName">ChildSlotName is the unique child identifier to use for the new content when creating it as a child of pParent (i.e., when pParent is not NULL)</param>
 /// <param name="flags">Options for the tab.</param>
 /// <param name="doc">The current Rhino document.</param>
 /// <returns>A new persistent render content.</returns>
 public static RenderContent Create(Type type, RenderContent parent, String childSlotName, ShowContentChooserFlags flags, RhinoDoc doc)
 {
   return Create(type.GUID, parent, childSlotName, flags, doc);
 }
    /// <summary>
    /// Implement to transfer data from another content to this content during creation.
    /// </summary>
    /// <param name="oldContent">An old content object from which the implementation may harvest data.</param>
    /// <returns>Information about how much data was matched.</returns>
    /*public virtual*/
    MatchDataResult MatchData(RenderContent oldContent)
    {
      if (IsNativeWrapper())
        return (MatchDataResult)UnsafeNativeMethods.Rdk_RenderContent_HarvestData(ConstPointer(), oldContent.ConstPointer());

      return (MatchDataResult)UnsafeNativeMethods.Rdk_RenderContent_CallHarvestDataBase(ConstPointer(), oldContent.ConstPointer());
    }
 internal override void CreateCppPointer(RenderContent parentContent, bool isVisibleToAutoUI)
 {
   base.CreateCppPointer(parentContent, isVisibleToAutoUI);
   UnsafeNativeMethods.Rdk_ContentField_SetStringValue(m_pField, m_defaultValue, (int)ChangeContexts.FieldInit);
 }
Beispiel #9
0
    /// <summary>
    /// Changes the type of a content. This deletes the content and creates a replacement
	  /// of the specified type allowing the caller to decide about harvesting.
    /// </summary>
    /// <param name="oldContent">oldContent is the old content which is deleted.</param>
    /// <param name="newType">The type of content to replace pOldContent with.</param>
    /// <param name="harvestParameters">Determines whether or not parameter harvesting will be performed.</param>
    /// <returns>A new persistent render content.</returns>
    public static RenderContent ChangeContentType(RenderContent oldContent, Guid newType, bool harvestParameters)
    {
      IntPtr pContent = UnsafeNativeMethods.Rdk_Globals_ChangeContentType(oldContent.NonConstPointer(), newType, harvestParameters);
      return IntPtr.Zero==pContent ? null : RenderContent.FromPointer(pContent);
    }
 internal virtual void CreateCppPointer(RenderContent parentContent, bool isVisibleToAutoUI)
 {
   m_pField = UnsafeNativeMethods.Rdk_ContentField_New(parentContent.ConstPointer(), m_sInternal, m_sFriendly, isVisibleToAutoUI ? 0 : 0x8001);
 }
 internal override void CreateCppPointer(RenderContent parentContent, bool isVisibleToAutoUI)
 {
   base.CreateCppPointer(parentContent, isVisibleToAutoUI);
   UnsafeNativeMethods.Rdk_ContentField_SetTimeValue(m_pField, m_defaultValue.Year, m_defaultValue.Month, m_defaultValue.Day, m_defaultValue.Hour, m_defaultValue.Minute, m_defaultValue.Second, (int)ChangeContexts.FieldInit);
 }
Beispiel #12
0
 public abstract bool Save(String pathToFile, RenderContent rc, CreatePreviewEventArgs ss);
 internal RenderContentFieldChangedEventArgs(RenderContent content, string fieldName, RenderContent.ChangeContexts cc)
   : base(content, cc)
 {
   m_field_name = fieldName;
 }
 /// <summary>
 /// Set another content as a child of this content. This content may or may
 /// not be attached to a document.  If this content already has a child
 /// with the specified child slot name, that child will be deleted.  If
 /// this content is not attached to a document, the child will be added
 /// without sending any events.  If this content is attached to a document,
 /// the necessary events will be sent to update the UI.
 /// Note:
 ///   Do not call this method to add children in your constructor. If you
 ///   want to add default children, you should override Initialize() and add
 ///   them there.
 /// </summary>
 /// <param name="renderContent">
 /// Child content to add to this content. If pChild is NULL, the function
 /// will fail.  If pChild is already attached to a document, the function
 /// will fail.  If pChild is already a child of this or another content,
 /// the function will fail.
 /// </param>
 /// <param name="childSlotName">
 /// The name that will be assigned to this child slot. The child slot name
 /// cannot be an empty string. If it is, the function will fail.
 /// </param>
 /// <param name="changeContexts">
 /// </param>
 /// <returns>
 /// Returns true if the content was added or the child slot with this name
 /// was modified otherwise; returns false.
 /// </returns>
 public bool SetChild(RenderContent renderContent, String childSlotName, ChangeContexts changeContexts)
 {
   if (renderContent == null)
     return DeleteChild(childSlotName, changeContexts);
   var found = FindChild(childSlotName);
   renderContent.ChildSlotName = childSlotName;
   return (found == null ? AddChild(renderContent) : ChangeChild(found, renderContent));
 }
Beispiel #15
0
 internal RenderContentEventArgs(RenderContent content) { m_content = content; }
Beispiel #16
0
 /// <summary>
 ///  Call this before modifying or deleting a content. Undo will cause the content to be restored.
 /// </summary>
 /// <param name="content">Content you are about to modify.</param>
 /// <returns>true if the content was modified.</returns>
 public bool ModifyContent(RenderContent content)
 {
   return 1 == UnsafeNativeMethods.Rdk_ContentUndo_ModifyContent(ConstPointer(), content.ConstPointer());
 }
Beispiel #17
0
 /// <summary>
 /// Constructs a new content of the specified type and add it to the persistent content list.
 /// This function cannot be used to create temporary content that you delete after use.
 /// Content created by this function is owned by RDK and appears in the content editor.
 /// To create a temporary content which is owned by you, call RhRdkContentFactories().NewContentFromType().
 /// </summary>
 /// <param name="type">is the type of the content to add.</param>
 /// <param name="parent">Parent is the parent content. If not NULL, this must be an RDK-owned content that is
 /// in the persistent content list (either top-level or child). The new content then becomes its child.
 /// If NULL, the new content is added to the top-level content list instead.</param>
 /// <param name="childSlotName">ChildSlotName is the unique child identifier to use for the new content when creating it as a child of pParent (i.e., when pParent is not NULL)</param>
 /// <param name="flags">Options for the tab.</param>
 /// <param name="doc">The current Rhino document.</param>
 /// <returns>A new persistent render content.</returns>
 public static RenderContent Create(Guid type, RenderContent parent, String childSlotName, ShowContentChooserFlags flags, RhinoDoc doc)
 {
   IntPtr pContent = UnsafeNativeMethods.Rdk_Globals_CreateContentByType(type, parent.ConstPointer(), childSlotName, (int)flags, doc.m_docId);
   return pContent == IntPtr.Zero ? null : FromPointer(pContent);
 }
Beispiel #18
0
 /// <summary>
 /// Call this before tweaking a single content parameter. Undo will cause the parameter to be restored.
 /// </summary>
 /// <param name="content">The render content</param>
 /// <param name="parameterName">The parameter name you are about to change.</param>
 /// <returns>true if the content was tweaked.</returns>
 public bool TweakContent(RenderContent content, String parameterName)
 {
   return 1 == UnsafeNativeMethods.Rdk_ContentUndo_TweakContent(ConstPointer(), content.ConstPointer(), parameterName);
 }
Beispiel #19
0
 /// <summary>
 /// Add a material, environment or texture to the internal RDK document lists as
 /// top level content.  The content must have been returned from
 /// RenderContent::MakeCopy, NewContentFromType or a similar function that returns
 /// a non-document content.
 /// </summary>
 /// <param name="renderContent">The render content.</param>
 /// <returns>true on success.</returns>
 public static bool AddPersistentRenderContent(RenderContent renderContent)
 {
   renderContent.AutoDelete = false;
   return 1 == UnsafeNativeMethods.Rdk_Globals_AddPersistentContent(renderContent.ConstPointer());
 }
 /// <summary>
 /// Called to save a custom RenderContent object as an external file.
 /// </summary>
 /// <param name="pathToFile">
 /// Full path of file to write
 /// </param>
 /// <param name="renderContent">
 /// Render content to save
 /// </param>
 /// <param name="previewArgs">
 /// Parameters used to generate a preview image which may be embedded in
 /// the exported file.
 /// </param>
 /// <returns></returns>
 public abstract bool Write(String pathToFile, RenderContent renderContent, CreatePreviewEventArgs previewArgs);