コード例 #1
0
bool IntersectionPoint::operator ==(const IntersectionPoint &IP) {
	/*cout<< "IP.coord1.begin().size: "<< IP.coord1.size() << endl;
	cout<< "el1_coord().size: "<< el1_coord().size() << endl;
	cout<< "IP.coord2.begin().size: "<< IP.coord2.size() << endl;
	cout<< "el2_coord().size: "<< el2_coord().size() << endl;
*/
	if (! equal (IP.coord1.begin(), IP.coord1.end(), el1_coord().begin(), eps_double_equal)) return false;
	if (! equal (IP.coord2.begin(), IP.coord2.end(), el2_coord().begin(), eps_double_equal)) return false;
	return true;
}
コード例 #2
0
IntersectionPoint *interpolate(const IntersectionPoint &A1, const IntersectionPoint &A2, double t) {
    if (! (A1.el1_coord().size() == 1 && A2.el1_coord().size() == 1 ) ) {
        THROW( ExcAssertMsg() << EI_Message( "Interpolation of IntersectionPoints with non line first element.") );
    }
    if (! (A1.el2_coord().size() == A2.el2_coord().size()) ) {
        THROW( ExcAssertMsg() << EI_Message( "Interpolation of IntersectionPoints with non matching second element type.") );
    }
    std::vector<double> el2_coord(A1.el2_coord().size());
	for(unsigned int  i = 0; i < el2_coord.size(); ++i) {
    	el2_coord[i] = ((t - A1.el1_coord()[0]) / (A2.el1_coord()[0] - A1.el1_coord()[0])) * (A2.el2_coord()[i] - A1.el2_coord()[i]) + A1.el2_coord()[i];
	}
    return new IntersectionPoint(std::vector<double>(1,t), el2_coord);
}
コード例 #3
0
bool IntersectionPoint::operator ==(const IntersectionPoint &IP) {
	if (! equal (IP.coord1.begin(), IP.coord1.end(), el1_coord().begin(), eps_double_equal)) return false;
	if (! equal (IP.coord2.begin(), IP.coord2.end(), el2_coord().begin(), eps_double_equal)) return false;
	return true;
}