Path: blob/main/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.cpp
169684 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file NIVissimBoundedClusterObject.cpp14/// @author Daniel Krajzewicz15/// @date Sept 200216///17// -------------------18/****************************************************************************/19#include <config.h>202122#include <cassert>23#include <utils/geom/Boundary.h>24#include "NIVissimBoundedClusterObject.h"2526NIVissimBoundedClusterObject::ContType NIVissimBoundedClusterObject::myDict;2728NIVissimBoundedClusterObject::NIVissimBoundedClusterObject()29: myBoundary(nullptr), myClusterID(-1) {30myDict.insert(this);31}323334NIVissimBoundedClusterObject::~NIVissimBoundedClusterObject() {35delete myBoundary;36}373839bool40NIVissimBoundedClusterObject::crosses(const AbstractPoly& poly,41double offset) const {42assert(myBoundary != 0 && myBoundary->xmax() >= myBoundary->xmin());43return myBoundary->overlapsWith(poly, offset);44}454647void48NIVissimBoundedClusterObject::inCluster(int id) {49myClusterID = id;50}515253bool54NIVissimBoundedClusterObject::clustered() const {55return myClusterID > 0;56}575859void60NIVissimBoundedClusterObject::closeLoading() {61for (ContType::iterator i = myDict.begin(); i != myDict.end(); i++) {62(*i)->computeBounding();63}64}656667const Boundary&68NIVissimBoundedClusterObject::getBoundary() const {69return *myBoundary;70}717273/****************************************************************************/747576