高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】regions
regions
regions
hello again,
i've posted before a similar question, but these answers are very important to me in order continue my application.
i`ve tried to construct a non-aligned with cartesian axis parallelogram, using the following code:
odgevector2d vec2dir1(5,3);
odgevector2d vec2dir2(-3,2);
odgepoint2d pt2dbase(3,0);
odgepoint2d pt2dpick(1,1);
odgeboundblock2d block2d(pt2dbase, vec2dir1, vec2dir2);
block2d.settobox(true);
bool bcontains=block2d.contains(pt2dpick);
i'm supposing that the parallelogram is constructed as follows:
from point (3,0) it comes to point (8,3), then it comes to point (5,5) and ends at point (0,2), i'm also assuming that coordinates of both vectors are refered to base point.
if this is correct, point (1,1) should not be contained by the parallelogran, but it is.
am i wrong about how the parallelogram is constructed?
is odgeboundblock2d the most suitable class in order to define a region associated with the space between two parallel oddbline entities?
is there any class associated with a region of arbitrary shape?
thanks in advance.
if you want to get parallelogram you need not call settobox(true). else you get a box: 0,0 - 8,5
do you need a geometry run time class or a class representing persistent database entity stored in file?
sergey slezkin
hello,
this is what i need:
in my application there are dd entities and myapp entities, with different relationships between them.
for example, there is a myapp entity called "viga".
a viga is compounded of two parallel (but of not equal length) oddbline entities.
i need to know whether a picked point is inside the region between these two lines, being vertex of this region the start and ending points of the oddbline entities, so in this case i think i need a run time geometry class.
but in other cases there is a one to one matching between my entities and a dd entity. for example, if i need to know whether the user has picked on a myapp entity that corresponds with a
oddbline, which class should i use?
|