Adding a goemetry object in an already started applet, behvior ?

Hello there,
I would like to add a geometric form (cube, box, cone etc..) in an already
started applet. I think creating a specific behavior would be the most
appropriate.
Has anybody done this kind of thing before ?
Many thanks.
Gwena�l

Great thread! I am having difficulty with removing objects from a scene graph. See source code below:
addTarget creates a grpahicsObject (class consisting of some data, mainly a 3d object which is attached to a transformGroup).
//function to add an aircrafat to display
     //attemps to create the aircraft in the specified location
     //returns false if the spot is not null
     public boolean addTarget(int location, float x, float y, float z)
          if(targets[location]!=null)
               return false;
          //create transform vector
          Vector3f targetTransform = new Vector3f(x,y,z);
          //create the object
          targets[location]= new GraphicsObject(targetTransform, TARGET_COLOR);
          //add it to the scene graph
          sadist.addObject(targets[location].getTransformGroup());
          return true;
//sadist is an object that contains my universe and pretty much controls my display
//the add object code adds the created to the scene graph by adding the transform group to a newly created branchgroup and than adding that to the mother branchgroup. The mother branchgroup was attached to the simple universe object (see code snipit)
private Applet CreateWorld()
          setLayout(new BorderLayout());
     //create a new canvas
     Canvas3D canvas3D = new Canvas3D(null); // NEED TO PASS IN SOMETHING
     //add canvas to applet
     add("Center", canvas3D);
     BranchGroup scene = createSceneGraph();
     mother = new BranchGroup();
          mother.setCapability(BranchGroup.ALLOW_DETACH);
          mother.setCapability(Group.ALLOW_CHILDREN_READ);
     mother.setCapability(Group.ALLOW_CHILDREN_WRITE);
     mother.setCapability(Group.ALLOW_CHILDREN_EXTEND);
     mother.addChild(scene);
     // SimpleUniverse is a Convenience Utility class
     // code reuse saves time
     simpleU = new SimpleUniverse(canvas3D);
          ViewingPlatform vp = simpleU.getViewingPlatform();
          TransformGroup steerTG = vp.getViewPlatformTransform();
          //create my transform
          Transform3D t3d = new Transform3D();
          steerTG.getTransform(t3d);
          //lookAt( from here, look here, vector up)
          t3d.lookAt( new Point3d (2,2,2),
                         new Point3d (0,0,0),
                         new Vector3d(0,1,0) );
          t3d.invert(); //inverted since the position is relative to the viewer
          //set the transform for the transform group
          steerTG.setTransform(t3d);
          simpleU.addBranchGraph(mother);
     return(this);
     //function to add transofrm group to scene graph
     public void addObject(TransformGroup object)
          //should I create a new branch graph, add the transform group, and then
          //add that to the simple u
          //I don't think this is right as I have no real way of identifying this
          //I need to look into a removeChild or something
          //could result in 1000's of null nodes on scene graph
          //yuck...
          System.out.println("going to add the transformg group to the branchgroup");
          BranchGroup t = new BranchGroup();
          t.setCapability(BranchGroup.ALLOW_DETACH);
          t.setCapability(Group.ALLOW_CHILDREN_READ);
          t.setCapability(Group.ALLOW_CHILDREN_WRITE);
     t.setCapability(Group.ALLOW_CHILDREN_EXTEND);
          t.addChild(object);
          t.compile();
          //simpleU.addBranchGraph(t);
          mother.addChild(t);
When I run the code with a tester function I can add the objects just fine but when I try to remove them (see code below) it doesn�t work.
//removal of targets will take place
     public void removeObject(int location) throws CapabilityNotSetException
          try
               //I tried detaching the branchgroup via the detach() function
               //howeve that wasn't successful either.
               mother.removeChild(location);
          catch(CapabilityNotSetException e)
               throw e;
Any advice you could give would be great.
Thanks,
Mike

Similar Messages

  • Adding a new item to an already existing BOM

    Hi,
        I am having a problem adding a new item to an already existing parent BOM.I excute the following code (as per the SDK).
        Dim vProdTree As SAPbobsCOM.ProductTrees
        Set vProdTree = vCmp.GetBusinessObject(oProductTrees)
        'Set Values to the fields
        vProdTree.TreeCode = "Item1"
        vProdTree.TreeType = iProductionTree
        'Set Values to the Assembly parts of the
        'First Assembly
        vProdTree.Items.ItemCode = Excel.Row(Cell1)
        vProdTree.Items.Price = 20
        vProdTree.Items.Quantity = 1
        vProdTree.Items.Currency = "Eur"
        'Adding the Product Tree
        RetVal = vProdTree.Add
        If (RetVal <> 0) Then
            vCmp.GetLastError ErrCode, ErrMsg
            MsgBox ErrCode & " " & ErrMsg
        End If
    If there is no parent BOM production tree with keycode Item1, then when the above code is run for the first time, it works.The issue occurs when I run change my excel, Cell1 to a different value and run the program again. The error states that the code already exists, which is correct, but does not  append the item to the existing BOM.
    I have tried vProdTree.Update, but this line overwrites the original child item in the BOM, rather than appending a new item, which is what I want it to do.
    Any  help is appreciated.
    - Adrian.V

    Your issue here is how the "Items" (which is actually pointing to ProductTree_Lines object) works. It is a List of items, and when you get the object is always pointing at the first item in the list.
    So for example, to add a BOM with two items you would need to set the details of the first Item and then add a line using vProdTree.Items.Add() before setting the values for that item.
    e.g.:
    Dim vProdTree As SAPbobsCOM.ProductTrees
    Set vProdTree = vCmp.GetBusinessObject(oProductTrees)
    'Set Values to the fields
    vProdTree.TreeCode = "Item1"
    vProdTree.TreeType = iProductionTree
    'Set Values to the Assembly parts of the
    'First Assembly
    vProdTree.Items.ItemCode = Excel.Row(Cell1)
    vProdTree.Items.Price = 20
    vProdTree.Items.Quantity = 1
    vProdTree.Items.Currency = "Eur"
    'Add a second item to the BOM
    vProdTree.Items.Add
    vProdTree.Items.ItemCode = Excel.Row(Cell2)
    vProdTree.Items.Price = 50
    vProdTree.Items.Quantity = 1
    vProdTree.Items.Currency = "Eur"
    'Adding the Product Tree
    RetVal = vProdTree.Add
    If (RetVal 0) Then
    vCmp.GetLastError ErrCode, ErrMsg
    MsgBox ErrCode & " " & ErrMsg
    End If
    To do what you want to do, which is get the BOM and add a new item to it, you will need to do this:
    Dim vProdTree As SAPbobsCOM.ProductTrees
    Set vProdTree = vCmp.GetBusinessObject(oProductTrees)
    'Get your BOM by key
    vProdTree.GetByKey("Item1")
    'Add a second item to the BOM
    'First Item exists so you need to add a new row
    vProdTree.Items.Add
    vProdTree.Items.ItemCode = Excel.Row(Cell1)
    vProdTree.Items.Price = 50
    vProdTree.Items.Quantity = 1
    vProdTree.Items.Currency = "Eur"
    'Update the Product Tree
    RetVal = vProdTree.Update
    If (RetVal 0) Then
    vCmp.GetLastError ErrCode, ErrMsg
    MsgBox ErrCode & " " & ErrMsg
    End If
    Method one allows you to add multiple lines as you add the object (which makes more sense), method 2 allows you to get the object after it has been added and add multiple lines to it. This is similar to how the Document_Lines object works.

  • Adding hyperlinks to objects in 3D PDF

    Hi everyone,
    I'm trying to figure out if 3D PDF has the capability to import a number of individual machine models (made in SolidWorks) to create a 3D layout of a facility, and then make it so people viewing this layout can click (or doubleclick) on a machine and have that open a web page (or another .pdf file)...are there javascript routines that get called when one of the objects is clicked/doubleclicked? If so, can that script be used to open up a url?
    Any help would be appreciated,
    Thanks,
    Jon Fournier

    On second thought, here is the an example code for adding hyperlinks to objects. It will be very tedious to do this for a huge number of parts. If metadata could be stored (no such luck) in the u3d file, this process would be very easy.
    - Greg
    http://www.immdesign.com
    The u3d file and pdf example are available using the links:
    http://www.immdesign.com/templates/hyperlink.pdf
    http://www.immdesign.com/templates/robotHand.u3d
    Parts of the code below were given to me by Grayson Lang.
    The code below must be added as a document level javascript
    use the menu - Advanced->Javascript->Document Javascript...
    // -------- Start of Document Script
    initialize3D = function ()
    var a3d = getAnnots3D(0)[0];
    var c3d = a3d.context3D;
    if ( a3d.activated )
    app.clearInterval( timeout );
    c3d.runtime.doc = this;
    c3d.runtime.app = app;
    var timeout = app.setInterval( "initialize3D()", 200 );
    // -------- End of Document Script
    // -------- Start of 3D Script
    // Save this code in as a .js file and use it as the default
    // script when inserting the u3d file into your PDF file
    // ugly code to add hyperlinks on selection of an object
    // this will only work with URLs and will not work for
    // just openning any old file
    // format for the hyperlink array -
    // hLinks["the object's name"] = "file URL"
    var hLinks = new Array;
    hLinks["fingertip-1"] = "http://www.immdesign.com"
    hLinks["fingertip-2"] = "http://www.myroombud.com"
    hLinks["fingertip-3"] = "http://www.adobe.com"
    function onSelection( objName ) {
    if ( typeof( hLink = eval( "hLinks['" + objName + "']" ) ) != 'undefined' ) {
    if (runtime.app) { runtime.app.launchURL(hLink); }
    // ack! we have to create our own "pick" function since there is no way
    // to get the selected object from the Acrobat pick right now
    var downX = -999999999999;
    var downY = -999999999999;
    var mouseDown = 0;
    myMouseHandler = new MouseEventHandler();
    myMouseHandler.onMouseDown = true; //this prop is true by default
    myMouseHandler.onMouseUp = true; //this prop is true by default
    myMouseHandler.onMouseMove = true;
    myMouseHandler.reportAllTargets = false;
    myMouseHandler.onEvent = function(event)
    // capture mouse down location
    if ( event.isMouseDown ) {
    downX = event.mouseX
    downY = event.mouseY
    mouseDown = 1;
    else {
    // check if mouse up is the same location as mouse down
    if ( event.isMouseUp ) {
    if ( downX == event.mouseX && downY == event.mouseY ) {
    if ( event.hits.length ) {
    objName = event.hits[0].target.name;
    onSelection( objName );
    downX = -999999999999;
    downY = -999999999999;
    mouseDown = 0;
    //Register the handler and turn the mule on
    runtime.addEventHandler(myMouseHandler);
    // ------ End of 3D Script

  • Error "Job already started" when calling a adobe form in Z function module

    Hi All,
    I have a error when calling a adobe form in a custom function module.
    I am using FP_FUNCTION_MODULE_NAME to get the adobe form function module and then i am using FP_JOB_OPEN function module to control the printing parameters such as no print preview or no dialog ..etc.. I dont have any exceptions during the call of FP_JOB_OPEN function module ..
    Later I am calling my function module which was generated for the adobe form and i am getting the error called " JOB ALREADY STARTED".
    I tried executing the same function module in se37 and the PDF form output was generated, and also by commenting FP_JOB_OPEN function module the PDF form output was generated.
    But i need the FP_JOB_OPEN function module to control the output based on the output type which triggers the form output such as the medium from nast record which says print or email or fax.. etc
    Please let me know how to handling this error.

    Just as a followup note. If you are testing a function module from SE37 and the test button you will get a value in SY-CPROG. You must override this value for everything to work.
    If you override the value of SY-CPROG with the main program that will be calling the function module you have no problem.
    John W.

  • TS1424 Hi, I've just rented a video, which says its going to take 14 hours to download. The 48 hours it gives you to watch the video has already started an hour ago. I had a message which says that I can start watching the film now but it dosen't play. Pl

    Hi,
    I've just rented a movie, which claims its going to take 14 hours to download. Its still at it after 1 hour. To make matters worse, the 48 hours it gives you to watch it has already started and charged me an hour. There was a message to say I could start watching it now but it dosen't work. Please can you help?

    You'll have to wait till it downloads much further than. If your download says it will take 14 hours to download, you have a very slow connection. You would never be able to watch the movie until it downloads completly.

  • How do you change the frame rate (or fmp) of a project once you have already started?

    I have been working on a project for a long time now, and I just reliezed that the frame rate of the project was 25 where as all my clips were in 30. Is there any possible way for me to change the frame rate even though I've already started the project? or do I have to start again?
    thanks

    Hi,
    I've had a really good search through our documentation and website but there's no previous record of that error code. However, a quick google search turned up lots of things on MatLab user groups and the MathWorks forums.
    MatWork's official stance is that the PCI 7342 is not supported in MatLab. They have a list of supported hardware here:
    https://www.mathworks.co.uk/products/daq/supported/ni-daqmx.html#PCI

  • How do i transfer my messages from iphone 3gs to iphone 4s and i have already started my new phone as well?

    how do i transfer my messages from iphone 3gs to iphone 4s and i have already started using my new phone as well??

    from iphone 5 to iphone 6

  • Satellite A100 - message: Toshiba Power Saver already started

    When I switch on with mains power connected, I get a false error message which says "Toshiba Power Saver already started".
    How do I get rid of this message permanently?

    Thanks for the response. I removed the Toshiba Power saver software through the Control Panel, no problems. I then downloaded the lastest software from the Toshiba website, a file named PA100-TPwr-Svr-7.00.03-XP.exe . At the completition of loading this program, I received an error message "A fatal error has occurred. The program will be terminated. Code 0x2." Subsequently, everytime I reboot the A100, I get this message. I tried uninstalling the new Toshiba Power saver program but am prevented from doing so by this error message. I also tried going back using thew System Restore but even going back two months, I get a message to say changes cannot be made (reversed). My computer is a model no PSAA8a-0D5010.
    Any hints??

  • Service of newly created database won't start if XE service already started

    Hi all,
    I install OracleXE 10g on WinXP SP1 and the default database (XE) is running well. Then I created a new database through TOAD but its window service won't start if XE service already started. If I shutdown the XE service than I can start the service of newly created database. This happens vice versa. When I forced to start the service of the new database with XE service already running windows told me to refer to service-specific error code 183.
    But even if I'm able to start the service of the new database when I try to login using SYSTEM sometime it throws 'Oracle not available' and sometime 'shared memory realm does not exist'.
    Here's my listener.ora:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
    (PROGRAM = extproc)
    (SID_DESC =
    (SID_NAME = CLRExtProc)
    (ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
    (PROGRAM = extproc)
    (SID_DESC =
    (ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
    (SID_NAME = CASHIN)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    (ADDRESS = (PROTOCOL = TCP)(HOST = SOLTIUS-SETYA)(PORT = 1521))
    DEFAULT_SERVICE_LISTENER = (XE)
    And here's my tnsnames.ora:
    XE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = SOLTIUS-SETYA)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    ORACLR_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    (CONNECT_DATA =
    (SID = CLRExtProc)
    (PRESENTATION = RO)
    CASHIN =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = SOLTIUS-SETYA)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = CASHIN)
    I also check the folder %ORACLE_BASE%\oradata\CASHIN folder but I found no single file there. While under oradata\XE I found 6 dbf's files.
    The reason why I created a new database is because I want to put Oracle files at another location instead of where XE files reside now.
    Any help would be greatly appreciated.
    Thanks in advanced.
    Regards,
    Setya

    Then I created a new database through TOADDid you read the part in the license agreement that says XE doesn't support multiple instances?
    ~Jer

  • Do ABAP WebDynpro objects need to be added to auth.object S_SERVICE in ECC6

    do ABAP WebDynpro objects need to be added to authorization objects in PFCG in ECC6.0?
    (Same as we add Java WebDynpro object names to S_SERVICE authorization object in PFCG)
    Thanks,
    Tiberiu

    I found authorization object S_ICF where I can add the ABAP WedDynpro applications.....unless someone else has a different opinion, I plan to close this thread....
    Tiberiu

  • If an internal ID is changed for the Work Repository how does it affect objects that are already in it?  Will they continue to run or do you need to cycle the ODI agent?

    I was having trouble migrating the Master and Work repositories from my QA to my Prod environment.  I was getting an error message that the internal id's were alike so I changed the internal id in my Prod Master repository.  Then I tried to migrate the Work repository and was getting a similar error.  I did a search on the internet for the error message and it recommended that I renumber the Work repository so I did.    My concern now is how these changes affect the objects that are already in the repositories?  Will those objects continue to run?  Also do these changes take affect immediately or do you need to cycle the ODI agent?

    Well I cannot completely assure you but so far I have not faced any issues after a renumber. It will affect the exist object only when you have imported the object in synonym_update mode. I believe you have the daily backup of your production repository.
    Bhabani
    http://dwteam.in

  • Can I stop iOS7 from downloading if I've already started it?

    Can I stop iOS7 from downloading if it's already started?

    It will automatically download when there is sufficiant space. There is no way to prevent it or to delete the download. If he doesn't want it, he'll have to leave it there and not click Install.

  • BRFplus: Adding Intermediate Data Objects to Expression Workarea

    Hi all,
    running BRFplus on NW 70105.
    I have a Step Sequence Expression with multiple steps calling various Functions.  Some of the Functions return intermediate results which must be stored in the context workarea.
    I would like to add these Data Objects to the workarea.  However the system will not allow me to do this without first adding the Data Objects as signature parameters of the calling Function, even though this does not make sense for intermediate values.
    Clicking the "Add existing Data Object" button for the workarea only allows me to add Data Objects which are in the context of the calling Function.
    Conversely if a Data Object is deleted from the calling Function's signature, then when checked the Function issues error message "Assigned expression uses Element CUSTOMER/Customer which is not in the context".
    Is the requirement to add all Expression workarea Data Objects to the calling Function's signature intended, or is this a bug ?  Or is there some other way of doing it that I am missing ??
    Thanks & regards,
    Grogan

    This is a restriction in NW 701. This restriction is removed in NW 702.

  • HCM errors in phase Identify Objects for Transfer and Start Data Selection.

    Hello Colleagues ,
    Background: We are using TDMS HCM PA PD Expert package to transfer all of the HCM data
    We are using TDMS 4.0 SP 5. We are trying to do the Configuraition in Identify Objects for Transfer and Start Data Selection.. In this phase, we are encountering the issue of 'choose to confirm to trigger data selection'.  The only option in this activit is'confirm batch' and 'confirm online'. Even if we press the button, we are still encountering issues. What selections then or values can we use?Thank you. Kindly see screen shot
    Regards,
    Meinard

    Hello Meinard,
    There could be two issues:
    First check if you have assigned the target ranges for the dialog user which you are using to select data from sender system. You need to maintain target ranges in activity 'Define target ranges for users' which you can find under activity "Configuration and Utilities in Control system".
    Secondly, there could be authorizaton issues for the sender system user. Check for any authorization issue in SU53 in sender system for the user which you used to logon to sender system.
    Thanks
    Anita

  • How do i finish a download that was already started and not finished because the library closed befo

    how do i finish a download that was already started and not finished because the library closed before it done

    What are you trying to download and how were you downloading it?

Maybe you are looking for