コード例 #1
0
ファイル: Element3D.cs プロジェクト: nbright/Diplomarbeit
 /// <summary>
 /// Attaches the element to the specified host.
 /// </summary>
 /// <param name="host">The host.</param>
 public virtual void Attach(IRenderHost host)
 {
     this.isAttached = true;
     this.device     = host.Device;
     this.effect     = host.Effects[effectName];
     this.renderHost = host;
 }
コード例 #2
0
 /// <summary>
 /// Used to override Detach
 /// </summary>
 protected virtual void OnDetach()
 {
     IsAttached      = false;
     renderTechnique = null;
     effect          = null;
     renderHost      = null;
 }
コード例 #3
0
ファイル: Element3D.cs プロジェクト: BEEden/Diplomarbeit
 /// <summary>
 /// Attaches the element to the specified host.
 /// </summary>
 /// <param name="host">The host.</param>
 public virtual void Attach(IRenderHost host)
 {
     this.isAttached = true;
     this.device = host.Device;
     this.effect = host.Effects[effectName];
     this.renderHost = host;
 }
コード例 #4
0
 /// <summary>
 /// Attaches the element to the specified host.
 /// </summary>
 /// <param name="host">The host.</param>
 public virtual void Attach(IRenderHost host)
 {
     this.renderTechnique = this.renderTechnique == null ? host.RenderTechnique : this.renderTechnique;
     this.effect          = EffectsManager.Instance.GetEffect(renderTechnique);
     this.renderHost      = host;
     this.InvalidateRender();
 }
コード例 #5
0
ファイル: Element3D.cs プロジェクト: zpfcaca/helix-toolkit
 /// <summary>
 /// Attaches the element to the specified host.
 /// </summary>
 /// <param name="host">The host.</param>
 public virtual void Attach(IRenderHost host)
 {
     renderTechnique = this.renderTechnique == null ? host.RenderTechnique : this.renderTechnique;
     renderHost      = host;
     effect          = renderHost.EffectsManager.GetEffect(renderTechnique);
     InvalidateRender();
 }
コード例 #6
0
 /// <summary>
 /// <para>Attaches the element to the specified host. To overide Attach, please override <see cref="OnAttach(IRenderHost)"/> function.</para>
 /// <para>To set different render technique instead of using technique from host, override <see cref="SetRenderTechnique"/></para>
 /// <para>Attach Flow: <see cref="SetRenderTechnique(IRenderHost)"/> -> Set RenderHost -> Get Effect -> <see cref="OnAttach(IRenderHost)"/> -> <see cref="OnAttached"/> -> <see cref="InvalidateRender"/></para>
 /// </summary>
 /// <param name="host">The host.</param>
 public void Attach(IRenderHost host)
 {
     if (IsAttached || host == null)
     {
         return;
     }
     renderHost = host;
     if (host.EffectsManager == null)
     {
         throw new ArgumentException("EffectManger does not exist. Please make sure the proper EffectManager has been bind from view model.");
     }
     this.renderTechnique = SetRenderTechnique(host);
     effect     = renderHost.EffectsManager.GetEffect(renderTechnique);
     IsAttached = OnAttach(host);
     if (IsAttached)
     {
         OnAttached();
     }
     InvalidateRender();
 }
コード例 #7
0
 /// <summary>
 /// Detaches the element from the host.
 /// </summary>
 public virtual void Detach()
 {
     this.renderTechnique = null;
     this.effect          = null;
     this.renderHost      = null;
 }
コード例 #8
0
ファイル: Element3D.cs プロジェクト: zpfcaca/helix-toolkit
 /// <summary>
 /// Detaches the element from the host.
 /// </summary>
 public virtual void Detach()
 {
     renderTechnique = null;
     effect          = null;
     renderHost      = null;
 }