How to get coordinates of QuadArray?

If I get QuadArray through picking,
how do I get the coordinates of the QuadArray?
Is there any method like (QuadArray.getCoordinates doubles[])
so I can get the Coordinate of the QuadArray?
Thanks in advances!
The code is as follows.
    Point3d[] ps=new Point3d[4];
    ps[0]=new Point3d(0.0,24.0,0.0);
    ps[1]=new Point3d(48,24.0,0.0);
    ps[2]=new Point3d(48,24.0,12.0);
    ps[3]=new Point3d(0,24.0,12.0);
    QuadArray qa=new QuadArray(4,QuadArray.COORDINATES|QuadArray.QuadArray.COLOR_3);
    qa.setCoordinates(0,ps);
    qa.setColors(0,cyan_s);
    Shape3D s3d=new Shape3D();
    s3d.setGeometry(qa);
    TransformGroup TG=new TransformGroup();
    TG.addChild(s3d);
    BranchGroup BG=new BranchGroup();
    BG.addChild(TG);

hi,
it might be the case that i am not able to get u properly,but wht i guess is u want a acess to (x,y,z) values in quad array..regarding tht as quadarray ia also an array so each element of it can be accessed through indexing,and then to retrive the x,y,z values u can use dot oprator..
eg:
x=qarray[0].x;
y=qarray[0].y;
i guess it will help...
kk

Similar Messages

  • How to get coordinates from Google Map

    I wonder how to get coordinates from Google Map to JavaFX application when click has occured. Here is an example of code:
    public class JavaFXApplication extends Application {
    public void showCoordinates(String coords)
            System.out.println("Coordinates: " + coords);
        @Override public void start(Stage stage)
            final WebView webView = new WebView();
            final WebEngine webEngine = webView.getEngine();
            webEngine.load(getClass().getResource("googlemap.html").toString());
            webEngine.getLoadWorker().stateProperty().addListener(
                    new ChangeListener<State>() {
                        @Override
                        public void changed(ObservableValue<? extends State> ov, State oldState, State newState) {
                            if (newState == State.SUCCEEDED) {
                                JSObject window = (JSObject) webEngine.executeScript("window");
                                window.setMember("java", new JavaFXApplication());
            BorderPane root = new BorderPane();
            root.setCenter(webView);
            stage.setTitle("Google maps");
            Scene scene = new Scene(root,1000,700, Color.web("#666970"));
            stage.setScene(scene);
            stage.show();
       public static void main(String[] args){
            Application.launch(args);
    // googlemap.html file
    <!DOCTYPE html>
    <html>
        <head>
            <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
            <style type="text/css">
                html { height: 100% }
                body { height: 100%; margin: 0px; padding: 0px }
                #map_canvas { height: 100%; background-color: #666970; }
            </style>       
            <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false">
            </script>
            <script type="text/javascript">           
                function initialize() {
                    var latlng = new google.maps.LatLng(40.75089, -73.93804);
                    var myOptions = {
                        zoom: 10,
                        center: latlng,
                        mapTypeId: google.maps.MapTypeId.ROADMAP,
                        mapTypeControl: false,
                        panControl: true,
                        navigationControl: true,
                        streetViewControl: false,
                        backgroundColor: "#666970"
                    var map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);    
                    document.map = map;
            google.maps.event.addListener(map, 'click', function(event) {
                //java.showCoordinates(event.latLng); ???
            map.setCenter(location);
            </script>
        </head>
        <body onload="initialize()">
            <div id="map_canvas" style="width:100%; height:100%"></div>
        </body>
    </html>Edited by: krbltik on 03.10.2012 22:59

    Hi, welcome!
    You may also have a look at GPS Info Qt, available for free at Ovi Store: http://store.ovi.com/content/165671
    GPS Info Qt is a nice Qt app. I have it on my C6-01 and I like it.
    Regards.

  • How to get coordinates of components. PLEASE HELP ME URGENT!

    Hi, I am trying to get the coordinates of my components that are tabbed pane buttons, buttons, text fields etc so I can place an image of a pointer under it that points to it and then under the image of the pointer I would put a label describing the button for example "press the tab to start". Then when I press tab1 the image of pointer image points to the next component and has a label under pointer.
    Now I have tried using componenet.getX() and getY() and then set the values of the the image panel to use then the label panel so they be placed under the component, these panels are not using layout manager but absolute positioning. If the window is resized then the labels and image of pointer should also adjust. I have tried putting the label and arrow into a glasspane and now layerdpane as some people here suggested which when I do then add it to contentpane the main panel with the components is not there but the layerd pane is.
    I am having huge difficulties with this and if someone can Please just tell me or even better give me an example code how to find out the coordinates of components so I can place my image of pointers and labels underneath them I will be very grateful of you. I am on a verge of giving up accomplish what I am doing and I am new to the swing framework. My progress to solve this has been very slow and frustrating. I just hope someone here can help.

    I tried the both of codes given. But the code given by both the person i have not understand. And what they there code is doing. This is the code form my side if this example help u.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    * Author Waheed-Ul-Haq ( BS(CS)-8 )
    public class Samulation2
         JPanel pane;
         JLabel label1;
         JTextField entProcesfld;
         JButton buttCreat;
         JButton buttReslt;
         JLabel usrProcesID[];
         JTextField usrArivTam[];
         int processes;
         public JComponent createComponents()
         pane = new JPanel();
         pane.setLayout (null);     
         label1 = new JLabel();     //Label for to tell user to enter no of Processes.
         label1.setText("Enter the no. of Processes");
         pane.add(label1);
         label1.setBounds(20, 25, 150, label1.getPreferredSize().height);
         entProcesfld = new JTextField();     //TextField to enter no of processes.
         entProcesfld.setToolTipText("Enter the no of Processes.");
         pane.add(entProcesfld);
         entProcesfld.setBounds(180, 25, 100, entProcesfld.getPreferredSize().height);
         buttCreat = new JButton();          //Button to create the TextFields.
         buttCreat.setText("Create TextFields");
         pane.add(buttCreat);               //Adding cutton to Jpane.
         buttCreat.setBounds(new Rectangle(new Point(30, 60), buttCreat.getPreferredSize()));
         buttCreat.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        buttCreatActionPerformed(e);
                   } } );          //ActionListenr to Create the TextFields.
         pane.setPreferredSize(new Dimension(600,600));
         return pane;
         }     //-------END of Component createComponents()--------//
         private void buttCreatActionPerformed(ActionEvent e)     //Action to Create the TextFields.
                   processes = Integer.parseInt (entProcesfld.getText ());
                   JLabel Labproces = new JLabel();     //Label of Processes.
                   Labproces.setText("Processes");
                   pane.add(Labproces);
                   Labproces.setBounds(new Rectangle(new Point(15, 105), Labproces.getPreferredSize()));
                   JLabel labArivTam = new JLabel();     //Label of Arival time.
                   labArivTam.setText("Arrial Time");
                   pane.add(labArivTam);
                   labArivTam.setBounds(new Rectangle(new Point(90, 105), labArivTam.getPreferredSize()));
                   //----Creating Dynamic JLabels------//
                   usrProcesID  = new JLabel[processes];     /* Makes an array */
                   int yXis = 125;          //Variable for Y-axix of JLabel.
                   for(int i=0; i<processes; i++)      /* i takes each value from 0 to processes-1 */
                    usrProcesID[i] = new JLabel("P" + i);      /* Makes a JLabel at an array place */
                    pane.add(usrProcesID);      /* Adds a JLabel (rather than an array) */
    usrProcesID[i].setBounds(new Rectangle(new Point(28, yXis), usrProcesID[i].getPreferredSize()));
    yXis = yXis + 25;     /* Increses the Y-axis to show JLabels. */
    }     //EndFor     
    //-------End Dynamic JLabels---------//               
                   //-----Creating Dynamic Arival Time TextFields-----//
                   usrArivTam = new JTextField[processes];          /* Makes an array */
                   yXis = 125;          //Variable for Y-axix of JTextField.
                   for(int i=0; i<processes; i++)      /* i takes each value from 0 to processes-1 */
    usrArivTam[i] = new JTextField();     /* Makes a JTextField at an array place */
    usrArivTam[i].setToolTipText("Enter Arival Time.");
    pane.add(usrArivTam[i]);      /* Adds a JTestField (rather than an array) */
    usrArivTam[i].setBounds(100, yXis, 35, usrArivTam[i].getPreferredSize().height);
    yXis = yXis + 25;     /* Increses the Y-axis to show JTextFields. */
    }     //EndFor     
    //-----End Dynamic Arival Time TextFields.-----//
    //----Calculating points for Label and textfields.
    Point poi = new Point();
    poi = usrArivTam[processes-1].getLocation ();     //Getting the location of the last text field of ArivalTime.
    //-----Label for Average Waiting time.--------\\
    JLabel averWaitLB = new JLabel();
    averWaitLB.setText("Average Waiting Time");
              pane.add(averWaitLB);
              averWaitLB.setBounds(new Rectangle(new Point(30, (int)poi.getY()+50), averWaitLB.getPreferredSize()));
    //-----TextField for Average Waiting Time.--------\\
    JTextField averWaitTF = new JTextField();
    averWaitTF.setText ("Hello");
    averWaitTF.setEditable(false);
    pane.add (averWaitTF);
    averWaitTF.setBounds(190, (int)poi.getY()+50, 35, averWaitTF.getPreferredSize().height);
    }     //------END of void buttResltActionPerformed(ActionEvent e)---------//
         private static void createAndShowGUI()
    //Make sure we have nice window decorations.
    JFrame.setDefaultLookAndFeelDecorated(true);
    //Create and set up the window.
    JFrame frame = new JFrame("Priority Scheduling (Non-Preemptive)....");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Samulation2 application = new Samulation2();
    //Create and set up the content pane.
    JComponent components = application.createComponents ();
    components.setOpaque (true);
    int vertSB = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS;
              int horzSB = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS;
              JScrollPane scrollPane = new JScrollPane(components, vertSB, horzSB);
    scrollPane.setPreferredSize (new Dimension(720,455));
    frame.getContentPane ().add (scrollPane,null);
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    }     //------END Of void createAndShowGUI()--------//
         public static void main(String[] args)
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
         }     //---------End of main()----------------//
    }     //--------END of class Samulation2----------//
    If any body help me implementing the ScrollBars in this code. I am unable to use Scroll Bars with this code while using NULL layout. If any body tell me how to get the Size and set for the pane.

  • How to get coordinates of FileSystemTree selected item ?

    Hi can some one clue me in how to get the coordinates of the
    selected itwn in a FileSystemsTree ?
    thx
    -g

    Hi Amy,
    I looked at the code, this is the width calculation.
    There are four (4) parts to each of the tree node display:
    1) the indent, from _listData.indent Only value id _data is
    not null
    2) the disclosureIcon.width
    3) icon.measuredWidth
    4) label measured or explicate width
    The positions are calculated by:
    1a) disclosureIcon.x = the indent
    1b) disclosureIcon.setActualSize = disclosureIcon.width,
    disclosureIcon.height
    2a) icon.x = the indent + disclosureIcon.width
    2b) icon.setActualSize = icon.width, icon.height
    3a) lable.x = the indent + disclosureIcon.width + icon.width
    3b) lable.setActualSize = lable.width, lable.height
    The label width:
    label.width: the size of the visible portion of the label in
    the parent. It may be clipped/truncated.
    label.textWidth: the total size of the text in the label
    Maybe I can get the code finished today.
    BTW, as I'm moving through this processes of learning flex,
    the one thing I've noticed is the lack of a concise MVC model or at
    least a breakout of the more complex UI components. I'd assume for
    such a strategic product, there would be more investment by Adobe
    in these technical areas. But, I guess its easier putting people on
    a bus and send them to city to city.
    -g

  • In Flex2, How to get coordinates in a view port?

    I know one can use something like
    fooUIControl.localToGlobal(new Point(x,y))
    to get the coordinates corresponding to the origin at the top
    left of the main flex app 'document'.
    In case that the main flex app scrolls, how can I get the
    coordinates corresponding to the origin at the top left of the
    visible screen (or the 'viewport')? Or in other words, how can I
    find out how many pixels are scrolled in X and Y? Thanks.

    The horizontalScrollPosition and verticalScrollPosition
    properties of a scrolling container tell you how many pixels it has
    scrolled.

  • How to get coordinates of a ROI in an image in Labview

    Hi,
    I have a question regarding image processing in NI-IMAQ. I have
    Ni-IMAQ module available, soon I may acquire NI-Vision too. I have an
    image file and I would like to draw a rectangle as Region of Interest
    (ROI) and be able to get the coordinates of the pixels in the ROI or
    along the edges of the ROI. I tried to find vis for this operation. I
    was able to find vis which provides the pixel values but I could not
    find the vis for the above operation. Any information regarding
    solution to above problem or any good resources for learning Labview
    and NI-IMAQ will be appreciated.
    Thanks,
    Ravi.

    Hello Ravi,
    Thank you for using our discussion forums. We can extract the ROI by using the two IMAQ functions "IMAQ Select Rectangle" and "IMAQ Extract".  From there we can get the ROI coordinates using a property node from the extracted image.   Also, here are some examples regarding ROI manipulation that you might find helpful. 
    http://zone.ni.com/devzone/cda/epd/p/id/1239
    http://zone.ni.com/devzone/cda/tut/p/id/2887
    Regards,
    Vu D
    Applications Engineer

  • How to get Coordinates of edges from image into excel

    Hi,
    I am new to labview and I am doing a project in which i move an XY stage under a laser to etch pictures.  So far I have managed to get the stage to move by reading off coordinates from an excel spread sheet and so can draw pictures if I have the coordinates.
     I am trying to use the vision module to be able to put any image in and then find the edges, get the coordinates of the edge and so draw the image.  Using the vision assistant I do colour plane extraction (to make greyscale) then use shape detection looking for lines with a small minimum length, this gets the information i want and if i click the button on the right that says send data to excell i get a spread sheet with all the information i need.  However, I cant get it to automatically save to excell (the write to spread sheet function doesnt work as "The type of the source is 1-D array of cluster of 5 elements."
    It would probably be bettter if i could use the output of the vision assistant (shape detection) straight away without having to save to excell but I cannot extract the information i need from the output as none of the array/cluster functions seem compatible with the data.  I am using labview 10 and have attached my VI below any help would be greatly appreciated!
    Attachments:
    image to coords (good).vi ‏109 KB

    Hello hzub1,
    It seems your having trouble getting to the information in the output of your Vision Assistant. You can use Context Help (Ctrl+H to show) to help understand the contents of a large array or cluster when you hover your mouse over the wire (see below).
    Looking at the above I created the code below which breaks out all the contents of one item in the array.
    Here I use the Index Array function to break out one element of the array. Each element is a circle descriptor, cluster of 5 elements so I use the Unbundle by Name function to access each of the values in the cluster
    I hope this helps,
    Jack. W
    Applications Engineer
    National Instruments

  • How to get the coordinate of a cell in the jtable?

    How to get the coordinate of a cell in the jtable?
    How to get the point of a cell in the jtable?
    Thanks for help!

    getCellRect(...);

  • How to get the x1,y1 and z1 coordinates out of an sdo_geometry object?

    Hello,
    i have stored several boxes into an sdo_geometry object like the following:
    mdsys.sdo_geometry(3003,null,null,
    mdsys.sdo_elem_info_array(1,1003,3),
    mdsys.sdo_ordinate_array(x1,y1,z1,x2,y2,z2)
    now i would like to get the x1,y1,z1 coordinates from the boxes. how can i get them with a simple sql-statement?
    When i do "SELECT v.shape.sdo_ordinates ..." then i get a sdo_ordinate_array. But how can i get only the first coorinates?
    I know how it works to get x1,y1 and z1 over a java-prog. But i want to get them with a sql-statement as i also want to get the min and max x1,y1,z1.
    Hope there is anybody that can help me. Thanks in advance.
    Markus Veith

    You can get coordinates from an SDO_POINT_TYPE as follows:
    SELECT      t.GEOMETRY.SDO_POINT.x,t.GEOMETRY.SDO_POINT.y
    FROM      TABLE T
    (where geometry is the geometry column and table is the geometry table, note
    that a table alias must be used.)
    Getting the coordinates from the SDO_ORDINATES is a little trickier.
    You'll need to use a loop in PL/SQL, eg:
    SET SERVEROUT ON
    DECLARE
    i number;
    j NUMBER;
    BEGIN
    FOR sel IN (SELECT <geom_column> FROM <geom_table> WHERE ROWNUM < 10) LOOP
    i := 1;
    while i < sel.<geom_column>.sdo_ordinates.count LOOP
    j:= sel.GEOMETRY.sdo_ordinates(i);
    dbms_output.put_line(j);
    i := i + 1;
    j:= sel.GEOMETRY.sdo_ordinates(i);
    end loop;
    dbms_output.put_line(j);
    END LOOP;
    END;
    This will print the SDO_ORDINATES to the SQLPLUS screen, put a WHERE clause to reduce output.
    To use these values in a query, put them in a cursor.

  • How to get Absolute Coordinates of a Field.

    I know that the properties "x" and "y" of any field of PDF Form will give me the coordinates relative to the parent object.
    How to get the absolute coordinates of any object (or any field) on a PDF Form?
    My objective is to make a Subform Visible or Hidden and reposition it close to any other field in order to display some extra text to show more info about the required field.
    How I can do that?
    Tarek.

    Hi,
    I wrote a recursive function that will go up in the forms hierarchy and summarizes the x and y coordinates of the parent objects.
    var vX = 0
    var vY = 0;
    function findCoordinates(vNode) {
        if (vNode !== null) {
            if (vNode.className === "field" || vNode.className === "subform") {
                console.println(vNode.name + " > " + vNode.x);
                var xUnit = vNode.x.match(/(mm|cm|pt|in)/g);
                var xValue = parseFloat(vNode.x.replace(xUnit, ""));
                if (xUnit === "mm") {
                    vX += xValue / parseFloat("25.4");
                } else if (xUnit === "cm") {
                    vX += xValue / parseFloat("2.54");
                } else if (xUnit === "pt") {
                    vX += xValue / 72;
                } else {
                    vX += xValue;
                var yUnit = vNode.y.match(/(mm|cm|pt|in)/g);
                var yValue = parseFloat(vNode.y.replace(yUnit, ""));
                if (yUnit === "mm") {
                    vY += yValue / parseFloat("25.4");
                } else if (yUnit === "cm") {
                    vY += yValue / parseFloat("2.54");
                } else if (yUnit === "pt") {
                    vY += yValue / 72;
                } else {
                    vY += yValue;
            findCoordinates(vNode.parent);
        var vCoordinates = (Math.round(vX * 2) / 2) + "mm " + (Math.round(vY * 2) / 2) + "mm";
        return vCoordinates;
    Textfeld2.rawValue = findCoordinates(xfa.resolveNode("Teilformular1.Teilformular2.Textfeld1"));

  • How to get the records which has a specified x/y coordinates

    Hi,
    How to get the records which has a specified x/y coordinates. I have a table which has street data. And another table has a point data. Now I just want to get the records from street data which includes the points in the point data table. Can any one give your suggestions
    Thanks and Regards
    Aravindan

    Aravinda,
    If you want to find the line segments which intersect the given
    set of points, you can do that with SDO_RELATE.
    siva

  • How to get Mouse Screen Coordinates

    Hi
    I have code:
    JButton btn  = new JButton("button");
    btn.addActionListener(new ActionListener()
        public void actionPerformed(ActionEvent e)
              //  HEAR I WANT TO GET MOUSE
              //  SCREEN COORDS!!!
    }I want to get Coordinates!!!

    If you have a MouseEvent you can convert it as follows:
    Point point = mouseEvent.getPoint();
    SwingUtilities.convertPointToScreen((Component)mouseEvent.getSource(), point);However, that won't work from your actionPerformed method. If possible, use a MouseListener and intercept the mousePressed/mouseClicked events.
    If you want to capture the mouse position when someone presses a button (e.g, by using an keyboard shortcut) then you'll need a MouseMotionListener to track the mouse pointer as it moves over your component.
    Hope this helps.

  • How to get location of 3D object in a hierarchy?

    It's easy enough to get the location of a 3D object at the root, but how do I get the location of a 3d object that is in a hierarchy?
    For instance, if I have a baseball player (biped - 3dsmax), grouped as "player" and exported to Director, how do I then get the location of the biped's hand?  (or the glove that is linked to the biped's hand).
    I tried just doing the basic...
    put member("BBplayer").model("glove").transform.position
    but director can't find the glove.
    It can find the root model "BBplayer", but not any child object.
    Anyone know how to get the location of a child object?
    Thanks!!

    I downloaded and installed that xtra and it really just shows the same info that I get in my object inspector.
    Ok, so for a biped and related skin/mesh/objects to export correctly to the .w3d file type, one has to select all the biped parts and related
    meshes into one Group.  This group then becomes the object in Director that all things are based from.  My charcter looks and animates
    fine in Director.  However, I still can't get coordinate information from anything inside this group or inside the hierarchy of this group, only
    the group itself.
    If I look at the group, either in the object inspector or the xtra you suggested, none of the child models appear under modelResources, model or group.  They simply don't show up as being in this group or the children to the group.  Nothing does except a few things that are useless, like "group("Bip01 Footsteps"), or some of the nubs, like headnub, fingernub and a couple of toenubs.  Why some nubs show up and some don't is yet another mystery.
    Anyhow, none of this makes logical sense.
    I simply want to "get" location information for any 3d model in the scene, regardless of what group it's in or the structure.  Anybody?  It has to be possible, this is a fundamental need of any 3D programming.
    Thanks!!!

  • How to get text's position in htmlText

    Dear All:
    I include some text into htmlText from a xml file and the
    text has serval paragraph,I want to add
    one grey rectangle background to every paragraph and need to
    get coordinate of ever paragraph.
    who can tell me how to realize it ?I'll appreciate for any
    reply.
    Best Regards
    Jacky

    Dear All:
    I include some text into htmlText from a xml file and the
    text has serval paragraph,I want to add
    one grey rectangle background to every paragraph and need to
    get coordinate of ever paragraph.
    who can tell me how to realize it ?I'll appreciate for any
    reply.
    Best Regards
    Jacky

  • How to get the value of Selected Dimension in a Pie Chart ?

    Hi All,
    Here is an example i'm working on ,
    JS Bin - Collaborative JavaScript Debugging&lt;/title&gt; &lt;link rel=&quot;icon&quot; href=&quot;http://static.jsbin.…
    I'm using selectData event to fire when any data is selected in the chart. How to get the value of dimension, in my case country which has been selected ?
    Thanks & Regards
    Sakthivel

    Hi,
    I added below code
    var oSelectData = oEvent.getParameter("data");
    // let the dataset convert the event coordinates back to a UI5 model context
    var oContext = this.getDataset().findContext(oSelectData[0].data[0].ctx.path);
                   console.log(oContext);
    in console  I am able to get the path of selected dimention.
    JS Bin - Collaborative JavaScript Debugging&lt;/title&gt; &lt;link rel=&quot;icon&quot; href=&quot;http://static.jsbin.…
    you can figure out how to get the data from this information.
    Regards,
    Chandra

Maybe you are looking for