Moby
ImpactToleranceException.h
1 /****************************************************************************
2  * Copyright 2012 Evan Drumwright
3  * This library is distributed under the terms of the Apache V2.0
4  * License (obtainable from http://www.apache.org/licenses/LICENSE-2.0).
5  ****************************************************************************/
6 
7 #ifndef _IMPACT_TOLERANCE_EXCEPTION_H_
8 #define _IMPACT_TOLERANCE_EXCEPTION_H_
9 
10 #include <list>
11 #include <stdexcept>
12 #include <Moby/UnilateralConstraint.h>
13 
14 namespace Moby {
15 
17 class ImpactToleranceException : public std::runtime_error
18 {
19  public:
20  ImpactToleranceException(const std::list<UnilateralConstraint*>& impacting_constraints, double max_vio) : std::runtime_error("Constraint velocity is below tolerance after treatment!") { constraints = impacting_constraints; violation = max_vio; }
21 
22  virtual ~ImpactToleranceException() throw() { }
23 
24  std::list<UnilateralConstraint*> constraints;
25  double violation; // the amount of constraint violation
26 }; // end class
27 
28 
29 } // end namespace
30 
31 #endif
32 
Exception thrown when constraint violation is greater than a desired tolerance.
Definition: ImpactToleranceException.h:17