Scott Sheppard

Who's Viewing

« Frederic Loranger: Autodesk Labs Project Freewheel Login Migration Stats | Main | Frederic Loranger: Consolidated Login - all is not lost »

September 24, 2008

Attention Programmers: What would you like to see in the Project Freewheel API?

One of our Project Freewheel software developers, Yuanfei Xu, is working on the collaboration solution software API. Here is what he has suggested. This is a work in progress.

  1. API Name: loadPath
    Description: Load the DWF file into freewheel object
    Arguments: zUrl (URL String of DWF file. Only support HTTP/FTP format…)
    Return: Null
    Example:

    var fw = new AdskLabs.Freewheel.Mashup(parentDivObj);
    fw.loadPath("http://freewheel.labs.autodesk.com/sample/CompositeSuspension.dwf");
    
  2. API Name: getPath
    Description: Get the path of current DWF file
    Arguments: Null
    Return: String (path of current DWF file)
    Example:

    var fw = new AdskLabs.Freewheel.Mashup(parentDivObj);
    document.getElementById("show").value = fw.getPath();
    
  3. API Name: setSection
    Description: Set the section of current DWF file in freewheel object
    Arguments: index (the index of the section)
    Return: Null
    Example:

    var fw = new Adsk.Freewheel.Mashup(parentDivObj);
    fw.setSection( 2 );
    
  4. API Name: getSection
    Description: Get the current section of current DWF file
    Arguments: Null
    Return: index( index of current section)
    Example:

    var fw = new Adsk.Freewheel.Mashup(parentDivObj);
    document.getElementById("show").value = fw.getSection();
    
  5. API Name: getSectionType
    Description: Get the current section Type (2D/3D) of current DWF file
    Arguments: Null
    Return: Return the value that indicate whether this section is 2D or 3D

    AdskLabs.Freewheel.SectionType = {
    	MODLE2D: 1,
     	MODLE3D: 2
    };
    

    Example:
    var fw = new Adsk.Freewheel.Mashup(parentDivObj);
    if( fw.getSection() == AdskLabs.Freewheel.SectionType.MODLE2D ){
    	setTransparent( picture );
    }
    
  6. API Name: setCamera
    Description: Set the camera information for DWF section
    Arguments: String
    Return: Null
    Example:

    var fw = new Adsk.Freewheel.Mashup(parentDivObj);
    fw.setCamera( "sec=1&scale=1&cx=0.5&cy=0.5" );
    
  7. API Name: getCamera
    Description: Get the camera of current DWF file
    Arguments: Null
    Return: String
    Example:

    var fw = new Adsk.Freewheel.Mashup(parentDivObj);
    document.getElementById("show").value = fw.getCamera();
    
  8. API Name: showButton
    Description: Show the buttons
    Arguments: Define an enumeration type.

    AdskLabs.Freewheel.Button = {
    	Pan:   1 << 0,
    	Zoom:  1 << 1,
    	Orbit: 1 << 2,
    	Wheel: 1 << 3,
    };
    

    Return: Null
    Example:
    var fw = new Adsk.Freewheel.Mashup(parentDivObj);
    fw.showButton(AdskLabs.Freewheel.Button.Pan | AdskLabs.Freewheel.Button.Zoom );
    
  9. API Name: hideButton
    Description: Hide the buttons
    Arguments: Define an enumeration type.

    AdskLabs.Freewheel.Button = {
        Pan:  1 << 0,
    	Zoom: 1 << 1,
        Orbit:1 << 2,
        Wheel:1 << 3
    };
    
    We will use that to pass into the function
    Return: Null
    Example:
    var fw = new Adsk.Freewheel.Mashup(parentDivObj);
    fw.hideButton(AdskLabs.Freewheel.Button.Pan | AdskLabs.Freewheel.Button.Zoom );
    
  10. API Name: showToolBar
    Description: Show the toolbars
    Arguments: Define an enumeration type

    AdskLabs.Freewheel.Toolbar = {
    Nav: 1 << 0
    };
    
    We will use that to pass arguments into the function
    Return: Null
    Example:
    var fw = new Adsk.Freewheel.Mashup(parentDivObj);
    fw.showToolBar(AdskLabs.Freewheel.Button.Nav );
    
  11. API Name: hideToolBar
    Description: Hide the toolbars
    Arguments: Define an enumeration type

    AdskLabs.Freewheel.Toolbar = {
    	Nav:1 << 0
    };
    
    We will use that to pass arguments into the function
    Return: Null
    Example:
    var fw = new Adsk.Freewheel.Mashup(parentDivObj);
    fw.hideToolBar(AdskLabs.Freewheel.Button.Nav );
    
  12. API Name: setCurrentTool
    Description: Set the default operation model for the freewheel object. For example, user want to pan the freewheel by default
    Arguments: Define an enumeration type

    AdskLabs.Freewheel.ActionTool = {
    	ZOOM:  1,
    	PAN:   2,
    	ORBIT: 3
    };
    

    Return: Null
    Example:
    var fw = new Adsk.Freewheel.Mashup(parentDivObj);
    fw.setCurrentTool(AdskLabs.Freewheel.ActionTool.PAN );
    
  13. API Name: registerEvent
    Description: When we operate the Freewheel object we want to give the 3rd party a chance to know something changed, and do something for that
    Arguments: Define an enumeration type

    AdskLabs.Freewheel.EventType = {
        PathChange:   1,
        SectionChange:2,
        CameraChange: 3
    };
    

    Example :
    var onPathChange = function( str ){
      document("_dwfPath").value = str;
    }
    var fw = new Adsk.Freewheel.Mashup(parentDivObj);
    fw.registerEvent( AdskLabs.Freewheel.EventType.PathChange, onPathChange);
    

If you have suggestions on what you would like to see, please email us at labs.freewheel@autodesk.com.

Getting feedback on how applications work with design data using software as service is alive in the lab.

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8341caed853ef010534a31b4b970c

Listed below are links to weblogs that reference Attention Programmers: What would you like to see in the Project Freewheel API?:

Comments

RSS Feed

Search