36 #include <wx/cmdproc.h>
61 parent_(NULL), figure_(NULL), model_(NULL), selectable_(
88 for (
unsigned i = 0; i <
children_.size(); i++) {
91 trashbag.insert(
this);
107 for (
unsigned int i = 0; i <
children_.size(); i++) {
115 #if wxCHECK_VERSION(2, 8, 0)
143 for (
unsigned int i = 0; i <
children_.size(); i++) {
165 int lastDist = std::numeric_limits<int>::max();
167 for (
unsigned int i = 0; i <
children_.size(); i++) {
168 found =
children_[i]->findNearest(point, exclude);
172 #if wxCHECK_VERSION(2, 8, 0)
173 if (foundRect.Contains(point)) {
175 if (foundRect.Inside(point)) {
181 if (
distance(point, foundRect) < lastDist) {
183 lastDist =
distance(point, foundRect);
194 #if wxCHECK_VERSION(2, 8, 0)
220 std::vector<EditPart*>& found) {
223 for (
unsigned int i = 0; i <
children_.size(); i++) {
224 totalFound +=
children_[i]->findInRange(point, radius, found);
232 found.push_back(
this);
233 return totalFound + 1;
248 if (editpolicy->
host() == NULL) {
279 for (
unsigned int i = 0; i <
children_.size(); i++) {
280 if (
children_.at(i)->hasEditPartRecursive(part)) {
298 vector<EditPolicy*>::const_iterator i =
editPolicies_.begin();
301 if (command != NULL) {
317 vector<EditPolicy*>::const_iterator i =
editPolicies_.begin();
319 if ((*i)->canHandle(request)) {
338 float xp =
static_cast<float>(p.x);
339 float yp =
static_cast<float>(p.y);
341 xr =
static_cast<float>(max(min(p.x, r.GetRight()), r.GetLeft()));
342 yr =
static_cast<float>(max(min(p.y, r.GetBottom()), r.GetTop()));
344 float dist = sqrt((xr - xp) * (xr - xp) + (yr - yp) * (yr - yp));