示例#1
0
const ValVec<htmRange> & 
htmInterface::domainCmd( char *str ) {

  cmd_ = str;
  if(t_)delete t_;
  t_ = new VarStrToken(cmd_);

  cmdCode code = getCode();
  if(code != HTMDOMAIN)
    throw SpatialInterfaceError("htmInterface:domainCmd: missing keyword HTMDOMAIN");
  getDepth();

  int32 nx,nc;
  nx = getInteger();

  SpatialDomain dom;
  for(int32 i = 0 ; i < nx; i++ ) {
    SpatialConvex convex;
    nc = getInteger();
    for(int32 j = 0; j < nc; j++ ) {
      float64 x = getFloat();
      float64 y = getFloat();
      float64 z = getFloat();
      float64 d = getFloat();
      SpatialConstraint c(SpatialVector(x,y,z),d);
      convex.add(c);
    }
    dom.add(convex);
  }

  return domain(dom);
}
示例#2
0
// CIRCLE
void HTMesh::intersect(double ra, double dec, double radius, BufNum bufNum)
{
    double d = cos(radius * degree2Rad);
    SpatialConstraint c(SpatialVector(ra, dec), d);
    RangeConvex convex;
    convex.add(c);                      // [ed:RangeConvex::add]

    if ( ! performIntersection(&convex, bufNum) )
        printf("In intersect(%f, %f, %f)\n", ra, dec, radius);
}
示例#3
0
const ValueVector & 
htmInterface::circleRegion( float64 ra,
			    float64 dec,
			    float64 rad ) {

	SpatialDomain dom;

	RangeConvex cvx;

	float64 d = cos(gPi * rad/10800.0);
	SpatialConstraint c(SpatialVector(ra,dec),d);
	cvx.add(c); // [ed:RangeConvex::add]
	dom.add(cvx);
	return domain(dom);
}
示例#4
0
const ValVec<htmRange> & 
htmInterface::circleRegion( float64 ra,
			    float64 dec,
			    float64 rad ) {

  SpatialDomain domain;
  SpatialConvex convex;
  float64 d = cos(gPi * rad/10800.0);
  SpatialConstraint c(SpatialVector(ra,dec),d);

  convex.add(c);
  domain.add(convex);
  domain.intersect(index_, idList_);

  range_.cut(range_.length());
  makeRange();

  return range_;
}
示例#5
0
Trixel HTMesh::index(double ra, double dec) const
{
    return (Trixel) htm->idByPoint( SpatialVector(ra, dec) ) - magicNum;
}