当前位置: 首页>>代码示例>>C++>>正文


C++ Projection类代码示例

本文整理汇总了C++中Projection的典型用法代码示例。如果您正苦于以下问题:C++ Projection类的具体用法?C++ Projection怎么用?C++ Projection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Projection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: fileLab

  /**
   * Set the output cube to specified file name and specified input images
   * and output attributes and lat,lons
   */
  Isis::Cube *ProcessMapMosaic::SetOutputCube(const QString &inputFile,
      double xmin, double xmax, double ymin, double ymax,
      double slat, double elat, double slon, double elon, int nbands,
      CubeAttributeOutput &oAtt, const QString &mosaicFile) {
    Pvl fileLab(inputFile);
    PvlGroup &mapping = fileLab.findGroup("Mapping", Pvl::Traverse);

    mapping["UpperLeftCornerX"] = toString(xmin);
    mapping["UpperLeftCornerY"] = toString(ymax);
    mapping.addKeyword(PvlKeyword("MinimumLatitude", toString(slat)), Pvl::Replace);
    mapping.addKeyword(PvlKeyword("MaximumLatitude", toString(elat)), Pvl::Replace);
    mapping.addKeyword(PvlKeyword("MinimumLongitude", toString(slon)), Pvl::Replace);
    mapping.addKeyword(PvlKeyword("MaximumLongitude", toString(elon)), Pvl::Replace);

    Projection *firstProj = ProjectionFactory::CreateFromCube(fileLab);
    int samps = (int)(ceil(firstProj->ToWorldX(xmax) - firstProj->ToWorldX(xmin)) + 0.5);
    int lines = (int)(ceil(firstProj->ToWorldY(ymin) - firstProj->ToWorldY(ymax)) + 0.5);
    delete firstProj;

    if (p_createMosaic) {
      Pvl newMap;
      newMap.addGroup(mapping);

      // Initialize the mosaic
      CubeAttributeInput inAtt;

      ProcessByLine p;
      p.SetInputCube(inputFile, inAtt);
      p.PropagateHistory(false);
      p.PropagateLabels(false);
      p.PropagateTables(false);
      p.PropagatePolygons(false);
      p.PropagateOriginalLabel(false);

      // If track set, create the origin band
      if (GetTrackFlag()) {
        nbands += 1;
      }
      // For average priority, get the new band count
      else if (GetImageOverlay() == AverageImageWithMosaic) {
        nbands *= 2;
      }

      Cube *ocube = p.SetOutputCube(mosaicFile, oAtt, samps, lines, nbands);
      p.Progress()->SetText("Initializing mosaic");
      p.ClearInputCubes();
      p.StartProcess(ProcessMapMosaic::FillNull);

      // CreateForCube created some keywords in the mapping group that needs to be added
      ocube->putGroup(newMap.findGroup("Mapping", Pvl::Traverse));
      p.EndProcess();
    }

    Cube *mosaicCube = new Cube();
    mosaicCube->open(mosaicFile, "rw");
    mosaicCube->addCachingAlgorithm(new UniqueIOCachingAlgorithm(2));

    AddOutputCube(mosaicCube);
    return mosaicCube;
  }
开发者ID:corburn,项目名称:ISIS,代码行数:64,代码来源:ProcessMapMosaic.cpp

示例2: buildPath

void Node::buildPath(const Projection& aProjection)
{
    if (ProjectionRevision != aProjection.projectionRevision()) {
        Projected = aProjection.project(BBox.topLeft());
        ProjectionRevision = aProjection.projectionRevision();
    }
}
开发者ID:chxyfish,项目名称:merkaartor,代码行数:7,代码来源:Node.cpp

示例3: fill

 void ScanAndOrder::fill( BufBuilder& b, const ParsedQuery *parsedQuery, int& nout ) const {
     int n = 0;
     int nFilled = 0;
     Projection *projection = parsedQuery ? parsedQuery->getFields() : NULL;
     scoped_ptr<Matcher> arrayMatcher;
     scoped_ptr<MatchDetails> details;
     if ( projection && projection->getArrayOpType() == Projection::ARRAY_OP_POSITIONAL ) {
         // the projection specified an array positional match operator; create a new matcher
         // for the projected array
         arrayMatcher.reset( new Matcher( parsedQuery->getFilter() ) );
         details.reset( new MatchDetails );
         details->requestElemMatchKey();
     }
     for ( BestMap::const_iterator i = _best.begin(); i != _best.end(); i++ ) {
         n++;
         if ( n <= _startFrom )
             continue;
         const BSONObj& o = i->second;
         massert( 16355, "positional operator specified, but no array match",
                  ! arrayMatcher || arrayMatcher->matches( o, details.get() ) );
         fillQueryResultFromObj( b, projection, o, details.get() );
         nFilled++;
         if ( nFilled >= _limit )
             break;
     }
     nout = nFilled;
 }
开发者ID:10genReviews,项目名称:mongo,代码行数:27,代码来源:scanandorder.cpp

示例4: CatalogInstance

void ListSelections::setProjectionList( ListProjections* l ) {

    m_lpListProjections = l;
    CatalogInstance* lpCatalog = NULL;
    lpCatalog = CatalogInstance::getCatalog(); //new CatalogInstance();
    if (lpCatalog == NULL)
        parser_error("Unable to create Catalog.");

    if( m_iSelectAll ) {
        m_iSelectAll = 0;
        list<Projection*> lp = m_lpListProjections->getProjections();
        for( list<Projection*>::iterator i = lp.begin(); i != lp.end(); i++ ) {
            Projection* p = (*i);
            string name = p->getAlias();
            if( name == "" ) {
                name = p->get();
            }

            vector<string>* lpListColumnNames = lpCatalog->getColumnNames(p->get());
            for(vector<string>::iterator i = lpListColumnNames->begin();
                    i != lpListColumnNames->end(); ++i) {
                EColumn* col = EColumn::create(name, *i);
                EHolder* lpHolder = EHolder::create(col);
                addSelection(lpHolder);
            }
        }
    }
}
开发者ID:plusql,项目名称:cstore,代码行数:28,代码来源:ListSelections.cpp

示例5:

bool
Projection::operator==(const Projection &Other) const {
    if (isNominalKind() && Other.isNominalKind()) {
        return Other.getDecl() == Decl;
    } else {
        return !Other.isNominalKind() && Index == Other.getIndex();
    }
}
开发者ID:fengweijp,项目名称:swift,代码行数:8,代码来源:Projection.cpp

示例6: pushCurrentMask

void ScreenMVCullVisitor::apply(Projection& node)
{

    // push the culling mode.
    pushCurrentMask();

    // push the node's state.
    StateSet* node_state = node.getStateSet();
    if(node_state)
        pushStateSet(node_state);

    // record previous near and far values.
    float previous_znear = _computed_znear;
    float previous_zfar = _computed_zfar;

    // take a copy of the current near plane candidates
    DistanceMatrixDrawableMap previousNearPlaneCandidateMap;
    previousNearPlaneCandidateMap.swap(_nearPlaneCandidateMap);

    _computed_znear = FLT_MAX;
    _computed_zfar = -FLT_MAX;

    ref_ptr < RefMatrix > matrix = createOrReuseMatrix(node.getMatrix());
    pushProjectionMatrix(matrix.get());

    //OSG_NOTIFY(osg::INFO)<<"Push projection "<<*matrix<<std::endl;

    // note do culling check after the frustum has been updated to ensure
    // that the node is not culled prematurely.

    bool status = _cullingStatus;
    bool firstStatus = _firstCullStatus;

    if(!isCulled(node))
    {
        handle_cull_callbacks_and_traverse(node);
    }

    _firstCullStatus = firstStatus;
    _cullingStatus = status;

    popProjectionMatrix();

    //OSG_NOTIFY(osg::INFO)<<"Pop projection "<<*matrix<<std::endl;

    _computed_znear = previous_znear;
    _computed_zfar = previous_zfar;

    // swap back the near plane candidates
    previousNearPlaneCandidateMap.swap(_nearPlaneCandidateMap);

    // pop the node's state off the render graph stack.    
    if(node_state)
        popStateSet();

    // pop the culling mode.
    popCurrentMask();
}
开发者ID:johnmangan,项目名称:calvr,代码行数:58,代码来源:ScreenMVCullVisitor.cpp

示例7: test_simple

static void
test_simple()
{
    Projection prj;
    prj.SetGeoLocation(GeoPoint::Zero());

    TestGeoScreenCouple(prj, GeoPoint(Angle::Zero(),
                                      Angle::Zero()), 0, 0);
}
开发者ID:j-konopka,项目名称:XCSoar-TE,代码行数:9,代码来源:TestProjection.cpp

示例8: DrawGeoBitmap

void
DrawGeoBitmap(const RawBitmap &bitmap, PixelSize bitmap_size,
              const GeoBounds &bounds,
              const Projection &projection)
{
  assert(bounds.IsValid());

  const BulkPixelPoint vertices[] = {
    projection.GeoToScreen(bounds.GetNorthWest()),
    projection.GeoToScreen(bounds.GetNorthEast()),
    projection.GeoToScreen(bounds.GetSouthWest()),
    projection.GeoToScreen(bounds.GetSouthEast()),
  };

  const ScopeVertexPointer vp(vertices);

  const GLTexture &texture = bitmap.BindAndGetTexture();
  const PixelSize allocated = texture.GetAllocatedSize();

  const GLfloat src_x = 0, src_y = 0, src_width = bitmap_size.cx,
    src_height = bitmap_size.cy;

  GLfloat x0 = src_x / allocated.cx;
  GLfloat y0 = src_y / allocated.cy;
  GLfloat x1 = (src_x + src_width) / allocated.cx;
  GLfloat y1 = (src_y + src_height) / allocated.cy;

  const GLfloat coord[] = {
    x0, y0,
    x1, y0,
    x0, y1,
    x1, y1,
  };

#ifdef USE_GLSL
  OpenGL::texture_shader->Use();
  glEnableVertexAttribArray(OpenGL::Attribute::TEXCOORD);
  glVertexAttribPointer(OpenGL::Attribute::TEXCOORD, 2, GL_FLOAT, GL_FALSE,
                        0, coord);
#else
  const GLEnable<GL_TEXTURE_2D> scope;
  OpenGL::glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);

  glEnableClientState(GL_TEXTURE_COORD_ARRAY);
  glTexCoordPointer(2, GL_FLOAT, 0, coord);
#endif

  glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

#ifdef USE_GLSL
  glDisableVertexAttribArray(OpenGL::Attribute::TEXCOORD);
  OpenGL::solid_shader->Use();
#else
  glDisableClientState(GL_TEXTURE_COORD_ARRAY);
#endif
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:56,代码来源:GeoBitmapRenderer.cpp

示例9: getProjection

string QMerge::toString() {
  string r = "";

  r = "MERGE ";

  Projection* p = getProjection();
  r += p->toString();

  return r;
}
开发者ID:mesadb,项目名称:mesadb.github.io,代码行数:10,代码来源:QMerge.cpp

示例10:

bool ProjectionSerializerV1::store(IlwisObject *obj, const IOOptions &options)
{
    if (!VersionedSerializer::store(obj, options))
        return false;
    Projection *proj = static_cast<Projection *>(obj);
    QString proj4Def = proj->toProj4();
    _stream << proj4Def;
    _stream << proj->authority();
    return true;

}
开发者ID:CarstenHollmann,项目名称:IlwisConnectors,代码行数:11,代码来源:projectionserializerv1.cpp

示例11: areProjectionsToDifferentFields

/// Returns true if we are accessing different fields.
static bool areProjectionsToDifferentFields(const Projection &P1,
        const Projection &P2) {
    // If operands have the same type and we are accessing different fields,
    // returns true. Operand's type is not saved in Projection. Instead we check
    // Decl's context.
    if (!P1.isNominalKind() || !P2.isNominalKind())
        return false;

    return P1.getDecl()->getDeclContext() == P2.getDecl()->getDeclContext() &&
           P1 != P2;
}
开发者ID:fengweijp,项目名称:swift,代码行数:12,代码来源:Projection.cpp

示例12: TestGeoScreenCouple

static void
TestGeoScreenCouple(const Projection prj, const GeoPoint geo,
                    long x, long y)
{
    RasterPoint tmp_pt = prj.GeoToScreen(geo);
    ok1(tmp_pt.x == x);
    ok1(tmp_pt.y == y);

    GeoPoint tmp_geo = prj.ScreenToGeo(x, y);
    ok1(equals(tmp_geo.latitude, geo.latitude));
    ok1(equals(tmp_geo.longitude, geo.longitude));
}
开发者ID:j-konopka,项目名称:XCSoar-TE,代码行数:12,代码来源:TestProjection.cpp

示例13: isProjectionExist

bool FileProjections::isProjectionExist(unsigned nodeId) const
{
    if (isMemoryUsed())
    {
        return Projections::isProjectionExist(nodeId);
    }
    Projection* pr = nullptr;
    if (loadedProjection && loadedProjection->getId() == nodeId)
        pr = loadedProjection;
    else
        pr = Projections::getProjection(nodeId);

    return !pr ? false : pr->fileExist();
}
开发者ID:Savelyev-Aleksey,项目名称:Compact-graph,代码行数:14,代码来源:FileProjections.cpp

示例14: TEST

//Simplistic test.
TEST(MAIN, Projection){
  Projection a;
  float PI_VAL = 3.14159;

  EXPECT_EQ( 1, a.zoom);
  EXPECT_EQ( 0, a.zoom_x);
  EXPECT_EQ( 0, a.zoom_y);


  EXPECT_TRUE(a.ex.x == 1.0) << a.ex.x;
  a.Reset();
  EXPECT_EQ( 1.0, a.X().x);
  a.Rotate( PI_VAL, PI_VAL);
  EXPECT_EQ( -1.0, a.X().x);
  
};
开发者ID:korantu,项目名称:vxx,代码行数:17,代码来源:vxProjection_UT.cpp

示例15: DrawGround

void MapPainterSVG::DrawGround(const Projection& projection,
                               const MapParameter& parameter,
                               const FillStyle& style)
{
    stream << "    <rect x=\"" << 0 << "\" y=\"" << 0 << "\" width=\"" << projection.GetWidth() << "\" height=\"" << projection.GetHeight() << "\"" << std::endl;
    stream << "          fill=\"" << GetColorValue(style.GetFillColor()) << "\"" << "/>" << std::endl;
}
开发者ID:OgreTransporter,项目名称:libosmscout,代码行数:7,代码来源:MapPainterSVG.cpp


注:本文中的Projection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。