[gme-users] About Port Location

Somesh Das somesh_au at yahoo.com
Tue Mar 7 04:20:24 CST 2017

Hi Kevin,
Thanks, Its working. Thanks & Regards
Somesh Das


    On Monday, March 6, 2017 8:59 PM, Kevin Smyth <kevin.m.smyth at gmail.com> wrote:

 Hi Somesh,
The decorator is responsible for determining where the ports are.
The default decorator has this code:if ((*ii)->portPart->GetInnerPosition().x <= WIDTH_MODELSIDE || (*ii)->portPart->GetInnerPosition().x < lMax / 2){ mapPrefs[PREF_LABELLOCATION] = PreferenceVariant(m_bPortLabelInside ? L_EAST : L_WEST); m_LeftPorts.push_back((*ii)->portPart);} else { mapPrefs[PREF_LABELLOCATION] = PreferenceVariant(m_bPortLabelInside? L_WEST: L_EAST); m_RightPorts.push_back((*ii)->portPart);}
lMax is the maximum x location of the ports. WIDTH_MODELSIDE is 100.

You could also ask the decorator. The basic procedure.Query your model's registry for "/decorator". If it doesn't exist, use "MGA.BoxDecorator" (the default decorator)CoCreateInstance the decoratorCall decorator.InitializeCall decorator.GetPorts (the decorator may choose to not display all ports)Call decorator.GetPortLocation for each port
Hope that helps.Kevin
On Mon, Mar 6, 2017 at 7:36 AM, Somesh Das <somesh_au at yahoo.com> wrote:

Hi,I am developing an interpreter using BON2Component which will create connections between two selected Object's ports.For this I need to get port location. I can get location of an object using method mentioned below
BON::Point pt = BON::FCOExRegistryNode( fco ->getRegistry())->getLocation( "");

However, I need to determine which port is in left side and which is in right side of the model. It must be implemented somewhere in GME.Please can anybody give me any suggestion how can I separate ports as left hand side and right hand side based on location ?
 Thanks & Regards
Somesh Das

______________________________ _________________
gme-users mailing list
gme-users at list.isis. vanderbilt.edu
http://list.isis.vanderbilt. edu/cgi-bin/mailman/listinfo/ gme-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20170307/a362d820/attachment.html>

More information about the gme-users mailing list