70001119 Support vdViews with vds format of vdraw web control

Article 70001119
Type Wish
Product WebJS
Version 7011
Date Added 7/6/2017
Fixed 7.7012.0.3 (7/19/2017)
Submitted by VectorDraw Team

Summary

Support vdViews with vds format of vdraw web control

Solution

In version 7012.0.3

vdViews are exported to vds web control format. See also article 70001115

Also following method of vdCanvas control was added

SetActiveView(object view) : change the active layout and the zoom properties according to the passed view

the passed view object can be a string that defines an existing view name or an existing view object
Example:

var view = vdcanvas.AddView("newview");
view.ViewRenderMode = vdConst.RENDERMODE_SHADE_GL;
vdcanvas.SetActiveView(view); // -or- vdcanvas.SetActiveView("newview");


GetActiveView :>Returns the document's active view as object.This may be null.

FindView(name as string) : Returns the vdView that has the given name or null if it does not exist.


AddView(name as string) : Adds a new view to the document's view collection.

Returns the created view object or an existing if a view with passed name already exist.
If a new view is created then it contains the zoom properties of the active layout.
The return view object contains the following properties.
ViewLayout : the hadle of the reference layout as string
ViewSize : the view size of selected view in drawing units
ViewWorldToViewMatrix : the matrix that defines the 3d view direction
ViewRenderMode : the render mode of the view object.see vdcanvas SetRenderMo de property for valid range values.
ViewCenter : the coordinate of the view center in selected view coordinate system.
ViewPerspectiveMod : the perspective mode of the view object.Valid values are 0 or 1
ViewFocalLength : the Focal length of the view object used when ViewPerspectiveMod is on.
ViewLensAngle : the lens angle in degreees of the view object used when ViewPerspectiveMod is on.
FrozenLayerList : Get/Set a string array contaning the names of the layers to be frozen in the view.
IgnoreFrozenLayers : Get/Set a boolean value that Ignores or not the default frozen property of document layers.
User can change one or more of these properties after the function return.

Example:

//create a new view and we set it active.

var view = vdcanvas.AddView("newview");
view.ViewRenderMode = vdConst.RENDERMODE_SHADE_GL;
vdcanvas.SetActiveView(view);

Send comments on this topic.