CADViewer Technical Documentation, Installation Guide and Reference Samples Library

methods for Selected & Changed

Methods cvjs_change_space(), cvjs_graphicalObjectCreated() and cvjs_ObjectSelected() are used for Space Management Interface creation and call-back when an object has been clicked for interation.

Mostly cvjs_change_space(), cvjs_graphicalObjectCreated() can be left empty, as all interaction can be tracked through cvjs_graphicalObjectOnChange():

The call-back cvjs_ObjectSelected() is always called when a Space Object has been clicked.

// generic callback method, tells which FM object has been clicked
function cvjs_change_space(){

function cvjs_graphicalObjectCreated(graphicalObject){
// do something with the graphics object created!

function cvjs_ObjectSelected(rmid){	
    var e = window.event;
    var posX = e.clientX;
    var posY = e.clientY;
    myBoundingBox = cvjs_ObjectBoundingBox_ScreenCoord(rmid);
    console.log("See callback: cvjs_ObjectSelected() "+rmid+" BBox: "+myBoundingBox.x+" "+myBoundingBox.y+" "+myBoundingBox.x2+" "+myBoundingBox.y2+" mouse x,y "+posX+"  "+posY);
    // hideOnlyPop(rmid);		
Last updated on 26 May 2022
Published on 9 Apr 2020