StelSphereGeometry.cpp   StelSphereGeometry.cpp 
skipping to change at line 48 skipping to change at line 48
QDataStream& operator<<(QDataStream& out, const SphericalRegionP& region) QDataStream& operator<<(QDataStream& out, const SphericalRegionP& region)
{ {
out << (quint8)region->getType(); out << (quint8)region->getType();
region->serialize(out); region->serialize(out);
return out; return out;
} }
QDataStream& operator>>(QDataStream& in, SphericalRegionP& region) QDataStream& operator>>(QDataStream& in, SphericalRegionP& region)
{ {
quint8 regType; quint8 regType = SphericalRegion::Invalid;
in >> regType; in >> regType;
switch (regType) switch (regType)
{ {
case SphericalRegion::Empty: case SphericalRegion::Empty:
region = EmptySphericalRegion::staticInstance; region = EmptySphericalRegion::staticInstance;
return in; return in;
case SphericalRegion::AllSky: case SphericalRegion::AllSky:
region = AllSkySphericalRegion::staticInstance; region = AllSkySphericalRegion::staticInstance;
return in; return in;
case SphericalRegion::Cap: case SphericalRegion::Cap:
skipping to change at line 148 skipping to change at line 148
return containsDefault(r); return containsDefault(r);
} }
Q_ASSERT(0); Q_ASSERT(0);
return false; return false;
} }
bool SphericalRegion::intersects(const SphericalPolygon& r) const {return i ntersectsDefault(&r);} bool SphericalRegion::intersects(const SphericalPolygon& r) const {return i ntersectsDefault(&r);}
bool SphericalRegion::intersects(const SphericalConvexPolygon& r) const {re turn intersectsDefault(&r);} bool SphericalRegion::intersects(const SphericalConvexPolygon& r) const {re turn intersectsDefault(&r);}
bool SphericalRegion::intersects(const SphericalCap& r) const {return inter sectsDefault(&r);} bool SphericalRegion::intersects(const SphericalCap& r) const {return inter sectsDefault(&r);}
bool SphericalRegion::intersects(const SphericalPoint& r) const {return con tains(r.n);} bool SphericalRegion::intersects(const SphericalPoint& r) const {return con tains(r.n);}
bool SphericalRegion::intersects(const AllSkySphericalRegion& r) const {ret urn getType()==SphericalRegion::Empty ? false : true;} bool SphericalRegion::intersects(const AllSkySphericalRegion&) const {retur n getType()==SphericalRegion::Empty ? false : true;}
bool SphericalRegion::intersects(const SphericalRegion* r) const bool SphericalRegion::intersects(const SphericalRegion* r) const
{ {
switch (r->getType()) switch (r->getType())
{ {
case SphericalRegion::Point: case SphericalRegion::Point:
return intersects(static_cast<const SphericalPoint*> (r)->n); return intersects(static_cast<const SphericalPoint*> (r)->n);
case SphericalRegion::Cap: case SphericalRegion::Cap:
return intersects(*static_cast<const SphericalCap*>( r)); return intersects(*static_cast<const SphericalCap*>( r));
case SphericalRegion::Polygon: case SphericalRegion::Polygon:
return intersects(*static_cast<const SphericalPolygo n*>(r)); return intersects(*static_cast<const SphericalPolygo n*>(r));
skipping to change at line 187 skipping to change at line 187
return getIntersection(static_cast<const SphericalPo int*>(r)->n); return getIntersection(static_cast<const SphericalPo int*>(r)->n);
case SphericalRegion::Cap: case SphericalRegion::Cap:
return getIntersection(*static_cast<const SphericalC ap*>(r)); return getIntersection(*static_cast<const SphericalC ap*>(r));
case SphericalRegion::Polygon: case SphericalRegion::Polygon:
return getIntersection(*static_cast<const SphericalP olygon*>(r)); return getIntersection(*static_cast<const SphericalP olygon*>(r));
case SphericalRegion::ConvexPolygon: case SphericalRegion::ConvexPolygon:
return getIntersection(*static_cast<const SphericalC onvexPolygon*>(r)); return getIntersection(*static_cast<const SphericalC onvexPolygon*>(r));
case SphericalRegion::AllSky: case SphericalRegion::AllSky:
return getIntersection(*static_cast<const AllSkySphe ricalRegion*>(r)); return getIntersection(*static_cast<const AllSkySphe ricalRegion*>(r));
case SphericalRegion::Empty: case SphericalRegion::Empty:
return false; return EmptySphericalRegion::staticInstance;
default: default:
return getIntersectionDefault(r); return getIntersectionDefault(r);
} }
Q_ASSERT(0); Q_ASSERT(0);
return SphericalRegionP(); return SphericalRegionP();
} }
SphericalRegionP SphericalRegion::getIntersection(const SphericalPolygon& r ) const {return getIntersectionDefault(&r);} SphericalRegionP SphericalRegion::getIntersection(const SphericalPolygon& r ) const {return getIntersectionDefault(&r);}
SphericalRegionP SphericalRegion::getIntersection(const SphericalConvexPoly gon& r) const {return getIntersectionDefault(&r);} SphericalRegionP SphericalRegion::getIntersection(const SphericalConvexPoly gon& r) const {return getIntersectionDefault(&r);}
SphericalRegionP SphericalRegion::getIntersection(const SphericalCap& r) co nst {return getIntersectionDefault(&r);} SphericalRegionP SphericalRegion::getIntersection(const SphericalCap& r) co nst {return getIntersectionDefault(&r);}
SphericalRegionP SphericalRegion::getIntersection(const SphericalPoint& r) const {return getIntersectionDefault(&r);} SphericalRegionP SphericalRegion::getIntersection(const SphericalPoint& r) const {return getIntersectionDefault(&r);}
SphericalRegionP SphericalRegion::getIntersection(const AllSkySphericalRegi on& r) const {return getIntersectionDefault(&r);} SphericalRegionP SphericalRegion::getIntersection(const AllSkySphericalRegi on& r) const {return getIntersectionDefault(&r);}
SphericalRegionP SphericalRegion::getIntersection(const EmptySphericalRegio n& r) const {return SphericalRegionP(new EmptySphericalRegion());} SphericalRegionP SphericalRegion::getIntersection(const EmptySphericalRegio n&) const {return SphericalRegionP(new EmptySphericalRegion());}
SphericalRegionP SphericalRegion::getUnion(const SphericalRegion* r) const SphericalRegionP SphericalRegion::getUnion(const SphericalRegion* r) const
{ {
switch (r->getType()) switch (r->getType())
{ {
case SphericalRegion::Point: case SphericalRegion::Point:
return getUnion(static_cast<const SphericalPoint*>(r )->n); return getUnion(static_cast<const SphericalPoint*>(r )->n);
case SphericalRegion::Cap: case SphericalRegion::Cap:
return getUnion(*static_cast<const SphericalCap*>(r) ); return getUnion(*static_cast<const SphericalCap*>(r) );
case SphericalRegion::Polygon: case SphericalRegion::Polygon:
return getUnion(*static_cast<const SphericalPolygon* >(r)); return getUnion(*static_cast<const SphericalPolygon* >(r));
case SphericalRegion::ConvexPolygon: case SphericalRegion::ConvexPolygon:
return getUnion(*static_cast<const SphericalConvexPo lygon*>(r)); return getUnion(*static_cast<const SphericalConvexPo lygon*>(r));
case SphericalRegion::AllSky: case SphericalRegion::AllSky:
return getUnion(*static_cast<const AllSkySphericalRe gion*>(r)); return getUnion(*static_cast<const AllSkySphericalRe gion*>(r));
case SphericalRegion::Empty: case SphericalRegion::Empty:
return false; return getUnion(*static_cast<const EmptySphericalReg ion*>(r));
default: default:
return getUnionDefault(r); return getUnionDefault(r);
} }
Q_ASSERT(0); Q_ASSERT(0);
return SphericalRegionP(); return SphericalRegionP();
} }
SphericalRegionP SphericalRegion::getUnion(const SphericalPolygon& r) const {return getUnionDefault(&r);} SphericalRegionP SphericalRegion::getUnion(const SphericalPolygon& r) const {return getUnionDefault(&r);}
SphericalRegionP SphericalRegion::getUnion(const SphericalConvexPolygon& r) const {return getUnionDefault(&r);} SphericalRegionP SphericalRegion::getUnion(const SphericalConvexPolygon& r) const {return getUnionDefault(&r);}
SphericalRegionP SphericalRegion::getUnion(const SphericalCap& r) const {re turn getUnionDefault(&r);} SphericalRegionP SphericalRegion::getUnion(const SphericalCap& r) const {re turn getUnionDefault(&r);}
SphericalRegionP SphericalRegion::getUnion(const SphericalPoint& r) const { return getUnionDefault(&r);} SphericalRegionP SphericalRegion::getUnion(const SphericalPoint& r) const { return getUnionDefault(&r);}
SphericalRegionP SphericalRegion::getUnion(const AllSkySphericalRegion& r) const {return SphericalRegionP(new AllSkySphericalRegion());} SphericalRegionP SphericalRegion::getUnion(const AllSkySphericalRegion&) co nst {return SphericalRegionP(new AllSkySphericalRegion());}
SphericalRegionP SphericalRegion::getUnion(const EmptySphericalRegion& r) c onst {return getUnionDefault(&r);} SphericalRegionP SphericalRegion::getUnion(const EmptySphericalRegion& r) c onst {return getUnionDefault(&r);}
SphericalRegionP SphericalRegion::getSubtraction(const SphericalRegion* r) const SphericalRegionP SphericalRegion::getSubtraction(const SphericalRegion* r) const
{ {
switch (r->getType()) switch (r->getType())
{ {
case SphericalRegion::Point: case SphericalRegion::Point:
return getSubtraction(static_cast<const SphericalPoi nt*>(r)->n); return getSubtraction(static_cast<const SphericalPoi nt*>(r)->n);
case SphericalRegion::Cap: case SphericalRegion::Cap:
return getSubtraction(*static_cast<const SphericalCa p*>(r)); return getSubtraction(*static_cast<const SphericalCa p*>(r));
case SphericalRegion::Polygon: case SphericalRegion::Polygon:
return getSubtraction(*static_cast<const SphericalPo lygon*>(r)); return getSubtraction(*static_cast<const SphericalPo lygon*>(r));
case SphericalRegion::ConvexPolygon: case SphericalRegion::ConvexPolygon:
return getSubtraction(*static_cast<const SphericalCo nvexPolygon*>(r)); return getSubtraction(*static_cast<const SphericalCo nvexPolygon*>(r));
case SphericalRegion::AllSky: case SphericalRegion::AllSky:
return getSubtraction(*static_cast<const AllSkySpher icalRegion*>(r)); return getSubtraction(*static_cast<const AllSkySpher icalRegion*>(r));
case SphericalRegion::Empty: case SphericalRegion::Empty:
return false; return getSubtraction(*static_cast<const EmptySpheri calRegion*>(r));
default: default:
return getSubtractionDefault(r); return getSubtractionDefault(r);
} }
Q_ASSERT(0); Q_ASSERT(0);
return SphericalRegionP(); return SphericalRegionP();
} }
SphericalRegionP SphericalRegion::getSubtraction(const SphericalPolygon& r) const {return getSubtractionDefault(&r);} SphericalRegionP SphericalRegion::getSubtraction(const SphericalPolygon& r) const {return getSubtractionDefault(&r);}
SphericalRegionP SphericalRegion::getSubtraction(const SphericalConvexPolyg on& r) const {return getSubtractionDefault(&r);} SphericalRegionP SphericalRegion::getSubtraction(const SphericalConvexPolyg on& r) const {return getSubtractionDefault(&r);}
SphericalRegionP SphericalRegion::getSubtraction(const SphericalCap& r) con st {return getSubtractionDefault(&r);} SphericalRegionP SphericalRegion::getSubtraction(const SphericalCap& r) con st {return getSubtractionDefault(&r);}
SphericalRegionP SphericalRegion::getSubtraction(const SphericalPoint& r) c onst {return getSubtractionDefault(&r);} SphericalRegionP SphericalRegion::getSubtraction(const SphericalPoint& r) c onst {return getSubtractionDefault(&r);}
SphericalRegionP SphericalRegion::getSubtraction(const AllSkySphericalRegio n& r) const {return SphericalRegionP(new EmptySphericalRegion());} SphericalRegionP SphericalRegion::getSubtraction(const AllSkySphericalRegio n&) const {return SphericalRegionP(new EmptySphericalRegion());}
SphericalRegionP SphericalRegion::getSubtraction(const EmptySphericalRegion & r) const {return getSubtractionDefault(&r);} SphericalRegionP SphericalRegion::getSubtraction(const EmptySphericalRegion & r) const {return getSubtractionDefault(&r);}
// Returns whether another SphericalPolygon intersects with the SphericalPo lygon. // Returns whether another SphericalPolygon intersects with the SphericalPo lygon.
bool SphericalRegion::containsDefault(const SphericalRegion* r) const bool SphericalRegion::containsDefault(const SphericalRegion* r) const
{ {
if (!getBoundingCap().contains(r->getBoundingCap())) if (!getBoundingCap().contains(r->getBoundingCap()))
return false; return false;
return getOctahedronPolygon().contains(r->getOctahedronPolygon()); return getOctahedronPolygon().contains(r->getOctahedronPolygon());
} }
skipping to change at line 384 skipping to change at line 384
for (int i=0;i<vArray.size()/3;++i) for (int i=0;i<vArray.size()/3;++i)
{ {
if (intersectsConvexContour(vArray.constData()+i*3, 3)) if (intersectsConvexContour(vArray.constData()+i*3, 3))
return true; return true;
} }
return false; return false;
} }
bool SphericalCap::clipGreatCircle(Vec3d& v1, Vec3d& v2) const bool SphericalCap::clipGreatCircle(Vec3d& v1, Vec3d& v2) const
{ {
if (v1==v2)
{
return contains(v1);
}
const bool b1 = contains(v1); const bool b1 = contains(v1);
const bool b2 = contains(v2); const bool b2 = contains(v2);
if (b1) if (b1)
{ {
if (b2) if (b2)
{ {
// Both points inside, nothing to do // Both points inside, nothing to do
return true; return true;
} }
else else
 End of changes. 9 change blocks. 
8 lines changed or deleted 12 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/