60000342 Lock Layers Changes and new implementations.

Article 60000342
Type Wish
Product Engine
Version 6010
Date Added 12/7/2007 12:00:00 AM
Fixed (12/11/2007 12:00:00 AM)
Submitted by stavros meimaroglou

Summary

Selectinting entities in Lock Layers method

Solution

Improvements of IngoreLockLayers property and generally how Locked layers can behave.

In version 6011 new property LockLayerMethod was added in vdDocument object as IgnoreLockLayersEnum

enum LockLayerMethodEnum 
{
     Entities in lock layers are only drawn.
     DisableAll = 0,
    
     Entities in lock layers can be added in selections.
     If this value is not present then entities in lock layers are not added in selections.</remarks>
     EnableAddToSelections = 1,
     
     Entities in lock layers can be modified.
     If this value is not present then a modification to a property of an entity will raize a <see cref="vdDocument.GenericError"/>.</remarks>
     EnableModifyEntity = 2,
     
     Entities in lock layers will show their snap points.
     EnableGetObjectSnap = 4, 

     Entities in lock layers will show their grip points. 
     EnableGetObjectGrip = 8,
     
     Entities in lock layers can be returned from single entity selection methods.
     EnableGetEntityFromPoint = 16,
     
     Entities in lock layers can display their tooltip. 
     EnableShowObjectToolTip = 32,
     
     Entities in lock layers take part in all methods like entities in unlock layers.
     EnableAll = 32 + 16 + 8 + 4 + 2 + 1,
     
     Default method.Entities in lock layers take part in all methods except from adding in selections and selecting object grips.
     Default = EnableModifyEntity | EnableGetObjectSnap | EnableGetEntityFromPoint | EnableShowObjectToolTip,
     
     Basic method. Entities in lock layers can not be modified.
     Basic = EnableAddToSelections | EnableGetObjectGrip | EnableGetObjectSnap | EnableGetEntityFromPoint | EnableShowObjectToolTip,
}


Also the LockLayerMethodStack added in vdDocument in order to give flexibility to developers to push and pop  LockLayerMethod value.
e.g.    
This can beused to the Load of your application giving a value that represents how locked layers should behave in your application. A Pop call should follow in order to return to the previous value.

ActivedDocument.LockLayerMethodStack.Push(
LockLayerMethodEnum.EnableAll);
.....
.....
ActivedDocument.LockLayerMethodStack.Pop();

Also new versions of vdLayOut.GetEntityFromPoint and Utility.getUserEntity methods added to give more options to developers.

Gets an entity passing through a rectangle with center a given point and given size.
Pt:The point in pixels.</param>
SelectingSize:Represents a rectangle size where the vdFigure entity passes from.</param>
BreakOnMessage:If this is true then and a windows message exists in the windows que then the searching will stop.</param>
locklayerMethod:The method to be used in combination with active <see cref="vdDocument.LockLayerMethod"/> property value, to test if entities belong in lock layer are accepted.</param>
<returns>The vdFigure object that passes from this point or null if none is found.</returns>
public vdFigure GetEntityFromPoint(Point Pt, int SelectingSize, bool BreakOnMessage, vdDocument.LockLayerMethodEnum locklayerMethod)

We added an extra parameter to the GetEntityFromPoint(the old method works as it used to) in order to provide more lock layers functionality. This extra parameter indicates the purpose of the GetEntityFromPoint in other words for example:

Fig = mLayout.GetEntityFromPoint(location, Render.GlobalProperties.PickSize, false, vdDocument.LockLayerMethodEnum.EnableAddToSelections);

By Default the GetEntityFromPoint checks the vdDocument.EnableGetEntityFromPoint  value but we can specify a value to check for our needs. In this case we want to use the GetEntityFromPoint in order to add an entity in a selection, and we pass the EnableAddToSelections value. The method then will search to the passed point for a non locked layer entity and return it if the EnableAddToSelections value is set to the vdDocument's property.

Same extra parameter added to getUserEntity.

Send comments on this topic.