Select materials in the window.

Source: Internet
Author: User

 
GW. getwinsizex ()
611 -- pick up the value returned by the current window.
1230
GW. getwinsizey ()
396
800

-- It is useful to pick up window Nodes Based on box2.
Ui = boxpicknode (box2 [0, 0] [1000,1000])
# ($ Sphere: sphere01 @ [45.523499, 34.512344, 0.000000], $ sphere: sphere02 @ [12.353422, 22.442947, 0.000000], $ sphere: sphere03 @ [-11.847525, 18.393448, 0.000000], $ sphere: sphere04 @ [-36.874302, 25.021164, 0.000000], $ sphere: sphere05 @ [-110.771210, 314.260803, 0.000000], $ sphere: sphere06 @ [-67.260963, 424.976379, 0.000000])

Select UI
OK

----- The circular pick-up method. The creation of this is different from that above.

--- Insert box2 syntax,

Box2 method application.

<Box2>.X:
Integer

<Box2>.Y:
Integer

<Box2>.W:
Integer

<Box2>.H:
Integer

<Box2>.Left:
Integer, alias of X Property

<Box2>.Right:
Integer

<Box2>.Top:
Integer, alias of Y Property

<Box2>.Bottom
: Integer

<Box2>.Center
: Point2, read-only

Box2 algorithm can be used

<Box2 >=< box2>

<Box2>! = <Box2> you can use logical judgment to determine whether to perform the operation.

Scale <box2> <float>
Scales the coordinates of the box about the center of the box.

Translate <box2> <point2>
Translates the coordinates of the box by the distance specified.

Contains <box2> <point2>
Determines if the point2 value is contained within the box2. returns true if the point is inside the box2 or on the box2 edge; otherwise false.

Rectify <box2>
Adjusts the coordinates of the box such that top <bottom and left <right.

Empty <box2>
Sets the box2 to a special "empty" value.

Isempty <box2>
Returns true if the box2 contains the special "empty" value, false otherwise.

I have never used the above box2 syntax. As information.

Box2 Experiment

Up = box2 0 0 100 100
(Box2 0 0 100 100)
(Box2 0 0 100 100)
Up. Center
[49,49]
99
0
99
99
0

--- It is best to draw a picture of box2 above. It is pixel-based. Therefore, the base point should be.

In this example, my algorithm is that the point2 below him hasRight BottomAdd the Left top algorithm minus 1.

ObtainRight The value of bottom.

 

 

**************************************** **************************************** ****************

Vpcenter = (point2 (GW. getwinsizex () (GW. getwinsizey ()/2
[615,400]
--- The center of the circle in the future.
--- I always find a range.
Circleregion = box2 0 0 0 0 -- initialize circleregion to a box2 Value
(Box2-1-1 2 2)

-- It will be represented with a circle. Here is the center point and the point above the circle.
Circleregion. Left = vpcenter. X -- the center of the circle -- A value is returned.

615.0
-- When we define the left. At this time, we can see that the value of circleregion is (box2-1-1 617 2)
--
-- It should be the first number on the left. Add the following X-1 = 615

Circleregion. Bottom = vpcenter. Y

400.0
---- We defined the bottom to see if circleregion is (box2-1 0 617 401)

Circleregion. Right = vpcenter. X/2 -- a point on the circle
307.5
Circleregion
(Box2 307 0 309 401)

Circleregion. Top = vpcenter. y -- the left and top coordinates of the first group, that is, the origin of the circle.
400.0
Circleregion (box2 307 400 309 1)

--- The above is the last group of coordinates. Bottom is the Y value of the next group, and the radius is determined by the preceding two numbers.
-- This is the case. Take the largest XY point in the attempt as the origin point, and perform parallel operations on X and cross-origin. The value of X is normal.
In this way, the origin and edge are available.

-- To put it bluntly, why can we select objects in the trial with the mouse? This function actually exists. It can be either square or circular.
Oop = for OBJ in (circlepicknode circleregion crossing: false) collect OBJ

# ($ Sphere: sphere01 @ [45.523499, 34.512344, 0.000000], $ sphere: sphere02 @ [12.353422, 22.442947, 0.000000], $ sphere: sphere03 @ [-11.847525, 18.393448, 0.000000], $ sphere: sphere04 @ [-36.874302, 25.021164, 0.000000], $ sphere: sphere05 @ [-110.771210, 314.260803, 0.000000], $ sphere: sphere06 @ [-67.260963, 424.976379, 0.000000])

--- In fact, I still don't understand it.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.