--- trunk/src/applications/hydrodynamics/CompositeShape.cpp 2006/03/29 18:09:26 921 +++ trunk/src/applications/hydrodynamics/CompositeShape.cpp 2006/06/05 18:24:45 981 @@ -43,48 +43,54 @@ namespace oopse { #include "utils/MemoryUtils.hpp" #include "applications/hydrodynamics/HydrodynamicsModel.hpp" namespace oopse { - -CompositeShape::~CompositeShape() { + + CompositeShape::~CompositeShape() { MemoryUtils::deletePointers(shapes_); -} -bool CompositeShape::isInterior(Vector3d pos) { + } + bool CompositeShape::isInterior(Vector3d pos) { bool result = false; std::vector::iterator iter; for (iter = shapes_.begin(); iter != shapes_.end(); ++ iter) { - if ((*iter)->isInterior(pos)) { - result = true; - break; - } + if ((*iter)->isInterior(pos)) { + result = true; + break; + } } - + return result; -} - -template -void swap_if(Cont& b1, Cont& b2, Predict predict) { + } + + template + void swap_if(Cont& b1, Cont& b2, Predict predict) { unsigned int size = b1.size(); assert(size == b2.size()); for (unsigned int i = 0 ; i < size; ++i) { - if (predict(b1[i], b2[i])) - std::swap(b1[i], b2[i]); + if (predict(b1[i], b2[i])) + std::swap(b1[i], b2[i]); } - -} - -std::pair CompositeShape::getBox() { + + } + + std::pair CompositeShape::getBoundingBox() { std::vector::iterator iter = shapes_.begin(); - std::pair boundary = (*iter)->getBox(); + std::pair boundary = (*iter)->getBoundingBox(); for (++iter; iter != shapes_.end(); ++iter) { - std::pair currBoundary = (*iter)->getBox(); - swap_if(boundary.first, currBoundary.first, std::greater()); - swap_if(boundary.second, currBoundary.second, std::less()); + std::pair currBoundary = (*iter)->getBoundingBox(); + swap_if(boundary.first, currBoundary.first, std::greater()); + swap_if(boundary.second, currBoundary.second, std::less()); } - + return boundary; + } + + HydroProp* CompositeShape::getHydroProp(RealType viscosity, RealType temperature) { + HydroProp* props; + props->setCOR(V3Zero); + sprintf( painCave.errMsg, + "CompositeShape was asked to return an analytic HydroProps.\n"); + painCave.severity = OOPSE_ERROR; + painCave.isFatal = 1; + simError(); + return props; + } } - -bool CompositeShape::calcHydroProps(HydrodynamicsModel* model, double viscosity, double temperature) { - return model->calcHydroProps(this, viscosity, temperature); -} - -}