• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ossimDrect类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: create

void ossimQuadTreeWarp::create(const ossimDrect& boundingRect,
                               const ossimDpt& ulShift,
                               const ossimDpt& urShift,
                               const ossimDpt& lrShift,
                               const ossimDpt& llShift)
{
   clear();

   theTree = new ossimQuadTreeWarpNode(boundingRect);

   ossimQuadTreeWarpVertex* ul = new ossimQuadTreeWarpVertex(boundingRect.ul(),
                                                             ulShift);
   ossimQuadTreeWarpVertex* ur = new ossimQuadTreeWarpVertex(boundingRect.ur(),
                                                             urShift);
   ossimQuadTreeWarpVertex* lr = new ossimQuadTreeWarpVertex(boundingRect.lr(),
                                                             lrShift);
   ossimQuadTreeWarpVertex* ll = new ossimQuadTreeWarpVertex(boundingRect.ll(),
                                                             llShift);
   ul->addSharedNode(theTree);
   ur->addSharedNode(theTree);
   lr->addSharedNode(theTree);
   ll->addSharedNode(theTree);

   theVertexList.push_back(ul);
   theVertexList.push_back(ur);
   theVertexList.push_back(lr);
   theVertexList.push_back(ll);
   
   theTree->theUlVertex = ul;
   theTree->theUrVertex = ur;
   theTree->theLrVertex = lr;
   theTree->theLlVertex = ll;
   
}
开发者ID:loongfee,项目名称:ossim-svn,代码行数:34,代码来源:ossimQuadTreeWarp.cpp


示例2: theVertexList

ossimPolygon::ossimPolygon(const ossimDrect& rect)
   : theVertexList(4),
     theCurrentVertex(0),
     theOrderingType(OSSIM_CLOCKWISE_ORDER)
{
   theVertexList[0] = rect.ul();
   theVertexList[1] = rect.ur();
   theVertexList[2] = rect.lr();
   theVertexList[3] = rect.ll();
}
开发者ID:,项目名称:,代码行数:10,代码来源:


示例3: pointList

void oms::SingleImageChain::setImageCut(const ossimDrect& rect)
{
   std::vector<ossimDpt> pointList(4);
   pointList[0] = rect.ul();
   pointList[1] = rect.ur();
   pointList[2] = rect.lr();
   pointList[3] = rect.ll();
   
   setImageCut(pointList);
}
开发者ID:loongfee,项目名称:ossim-svn,代码行数:10,代码来源:SingleImageChain.cpp


示例4: clipToRect

bool ossimPolygon::clipToRect(vector<ossimPolygon>& result,
                              const ossimDrect& rect)const
{
   result.clear();
   ossimPolyArea2d p1(*this);
   ossimPolyArea2d p2(rect.ul(), rect.ur(), rect.lr(), rect.ll());
   
   p1&=p2;

   p1.getVisiblePolygons(result);

   return (result.size() > 0);
}   
开发者ID:,项目名称:,代码行数:13,代码来源:


示例5: evt

void oms::SingleImageChain::setViewCut(const ossimDrect& rect, bool imageSpaceFlag)
{
   if(!imageSpaceFlag)
   {
      
      const ossimProjection* proj = getViewProjection();
      
      if(proj)
      {
         std::vector<ossimGpt> pointList(4);
         proj->lineSampleToWorld(rect.ul(), pointList[0]);
         proj->lineSampleToWorld(rect.ur(), pointList[1]);
         proj->lineSampleToWorld(rect.lr(), pointList[2]);
         proj->lineSampleToWorld(rect.ll(), pointList[3]);
         setViewCut(pointList);
      }
   }
   else
   {
      std::vector<ossimDpt> pointList(4);
      pointList[0] = rect.ul();
      pointList[1] = rect.ur();
      pointList[2] = rect.lr();
      pointList[3] = rect.ll();
      theViewCutter->setEnableFlag(false);
      theViewImageCutter->setEnableFlag(true);
      theViewImageCutter->setPolygon(pointList);
      theViewImageCutter->initialize();
      ossimPropertyEvent evt(theViewImageCutter);
      theViewImageCutter->propagateEventToOutputs(evt);
   }
}
开发者ID:loongfee,项目名称:ossim-svn,代码行数:32,代码来源:SingleImageChain.cpp


示例6: imageToView

ossimDrect ossimImageViewTransform::getImageToViewBounds(const ossimDrect& imageRect)const
{
    ossimDpt p1;
    ossimDpt p2;
    ossimDpt p3;
    ossimDpt p4;

    imageToView(imageRect.ul(), p1);
    imageToView(imageRect.ur(), p2);
    imageToView(imageRect.lr(), p3);
    imageToView(imageRect.ll(), p4);

    return ossimDrect(p1, p2, p3, p4);
}
开发者ID:whztt07,项目名称:star_ossim,代码行数:14,代码来源:ossimImageViewTransform.cpp


示例7: initialize

//*****************************************************************************
//  METHOD: ossimDblGrid::initialize()
//  
//  Permits initialization after construction
//  
//*****************************************************************************
void ossimDblGrid::initialize(const ossimDrect&  uv_rect, 
                              const ossimDpt&    spacing,
                              double null_value)
{
   static const char MODULE[] = "ossimDblGrid::initialize()";
   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";

   ossimIpt size ((int) (uv_rect.width()/spacing.x)  + 1,
      (int) (uv_rect.height()/spacing.y) + 1);

   initialize(size, uv_rect.ul(), spacing, null_value);

   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
   return;
}
开发者ID:LucHermitte,项目名称:ossim,代码行数:21,代码来源:ossimDblGrid.cpp


示例8: imageGpts

//**************************************************************************************************
// Converts the local image space rect into bounding view-space rect
//**************************************************************************************************
ossimDrect ossimImageViewProjectionTransform::getImageToViewBounds(const ossimDrect& imageRect)const
{
    // Let base class try:
   ossimDrect result = ossimImageViewTransform::getImageToViewBounds(imageRect);

   // If not successful, compute using input and output geometries:
   if (result.hasNans() && m_imageGeometry.valid() && m_viewGeometry.valid() &&
       m_imageGeometry->hasProjection() && m_viewGeometry->hasProjection())
   {
      ossimGeoPolygon viewClip;
      m_viewGeometry->getProjection()->getGroundClipPoints(viewClip);
      if(viewClip.size())
      {
         std::vector<ossimGpt> imageGpts(4);
         m_imageGeometry->localToWorld(imageRect.ul(), imageGpts[0]);
         m_imageGeometry->localToWorld(imageRect.ur(), imageGpts[1]);
         m_imageGeometry->localToWorld(imageRect.lr(), imageGpts[2]);
         m_imageGeometry->localToWorld(imageRect.ll(), imageGpts[3]);

         const ossimDatum* viewDatum = m_viewGeometry->getProjection()->origin().datum();
         imageGpts[0].changeDatum(viewDatum);
         imageGpts[1].changeDatum(viewDatum);
         imageGpts[2].changeDatum(viewDatum);
         imageGpts[3].changeDatum(viewDatum);
         
         ossimPolyArea2d viewPolyArea(viewClip.getVertexList());
         ossimPolyArea2d imagePolyArea(imageGpts);
         viewPolyArea &= imagePolyArea;
         std::vector<ossimPolygon> visiblePolygons;
         viewPolyArea.getVisiblePolygons(visiblePolygons);
         if(visiblePolygons.size())
         {
            std::vector<ossimDpt> vpts;
            ossim_uint32 idx = 0;
            for(idx=0; idx<visiblePolygons[0].getNumberOfVertices();++idx)
            {
               ossimDpt tempPt;
               ossimGpt gpt(visiblePolygons[0][idx].lat, visiblePolygons[0][idx].lon, 0.0,  viewDatum);
               m_viewGeometry->worldToLocal(gpt, tempPt);
               vpts.push_back(tempPt);
            }
            result = ossimDrect(vpts);
         }
      }
   }
   return result;
}
开发者ID:LucHermitte,项目名称:ossim,代码行数:50,代码来源:ossimImageViewProjectionTransform.cpp


示例9: intersects

//*******************************************************************
// Public Method:
//*******************************************************************
bool ossimDrect::intersects(const ossimDrect& rect) const
{
    if(rect.hasNans() || hasNans())
    {
        return false;
    }
    if (theOrientMode != rect.theOrientMode)
        return false;

    ossim_float64  ulx = ossim::max(rect.ul().x,ul().x);
    ossim_float64  lrx = ossim::min(rect.lr().x,lr().x);
    ossim_float64  uly, lry;
    bool rtn=false;
    if (theOrientMode == OSSIM_LEFT_HANDED)
    {
        uly  = ossim::max(rect.ul().y,ul().y);
        lry  = ossim::min(rect.lr().y,lr().y);
        rtn = ((ulx <= lrx) && (uly <= lry));
    }
    else
    {
        uly  = ossim::max(rect.ll().y,ll().y);
        lry  = ossim::min(rect.ur().y,ur().y);
        rtn = ((ulx <= lrx) && (uly <= lry));
    }

    return (rtn);
}
开发者ID:whztt07,项目名称:star_ossim,代码行数:31,代码来源:ossimDrect.cpp


示例10: size

/*!****************************************************************************
*  CONSTRUCTOR: ossimDblGrid
*  
*****************************************************************************/
ossimDblGrid::ossimDblGrid(const ossimDrect&  rect, 
                           const ossimDpt&    spacing,
                           double             null_value)
                           :
theGridData   (0),
theMinValue   (OSSIM_DEFAULT_MIN_PIX_DOUBLE),
theMaxValue   (OSSIM_DEFAULT_MAX_PIX_DOUBLE),
theExtrapIsEnabled (true),
theDomainType (CONTINUOUS)
{
   static const char MODULE[] = "ossimDblGrid Constructor";
   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";

   ossimIpt size ((int) (rect.width()/spacing.x)  + 1,
      (int) (rect.height()/spacing.y) + 1);

   initialize(size, rect.ul(), spacing, null_value);

   if (traceExec())  ossimNotify(ossimNotifyLevel_WARN) << MODULE << " returning...\n";
}
开发者ID:LucHermitte,项目名称:ossim,代码行数:24,代码来源:ossimDblGrid.cpp


示例11: intersects

bool ossimAnnotationMultiPolyObject::intersects(const ossimDrect& rect)const
{
    // do the quick checks first
    //
    if(rect.hasNans()) return false;
    if(!rect.intersects(theBoundingRect)) return false;
    if(theMultiPolygon.size()<1) return false;

    for(ossim_uint32 i =0; i < theMultiPolygon.size(); ++i)
    {
        vector<ossimPolygon> result;

        if(theMultiPolygon[i].clipToRect(result, rect))
        {
            return true;
        }
    }

    return false;
}
开发者ID:whztt07,项目名称:star_ossim,代码行数:20,代码来源:ossimAnnotationMultiPolyObject.cpp


示例12: getCode

//*******************************************************************
// Public Method: ossimDrect::getCode
//*******************************************************************
long ossimDrect::getCode(const ossimDpt& aPoint,
                         const ossimDrect& clipRect)
{
    long result=NONE; // initialize to inside rect

    if( (aPoint.x > clipRect.lr().x) )
        result |= RIGHT;
    else if( (aPoint.x < clipRect.ul().x) )
        result |= LEFT;

    if (clipRect.theOrientMode == OSSIM_LEFT_HANDED)
    {
        if( (aPoint.y < clipRect.ul().y) )
            result |= TOP;
        else if( (aPoint.y > clipRect.lr().y) )
            result |= BOTTOM;
    }
    else
    {
        if( (aPoint.y > clipRect.ul().y) )
            result |= TOP;
        else if( (aPoint.y < clipRect.lr().y) )
            result |= BOTTOM;
    }

    return result;
}
开发者ID:whztt07,项目名称:star_ossim,代码行数:30,代码来源:ossimDrect.cpp


示例13: completely_within

//*******************************************************************
// Public Method: ossimDrect::completely_within
//*******************************************************************
bool ossimDrect::completely_within(const ossimDrect& rect) const
{
    if(hasNans() || rect.hasNans())
    {
        return false;
    }
    if (theOrientMode != rect.theOrientMode)
        return false;

    /*  --------------
        |     1      |
        | ---------- |
        | |        | |
        | |        | |
        | |   2    | |
        | |        | |
        | |        | |
        | ---------- |
        |            |
        --------------  */

    bool rtn = true;

    if (theUlCorner.x < rect.ul().x)
        rtn = false;

    else if (theLrCorner.x > rect.lr().x)
        rtn = false;

    else if (theOrientMode == OSSIM_LEFT_HANDED)
    {
        if (theUlCorner.y < rect.ul().y)
            rtn = false;

        else if (theLrCorner.y > rect.lr().y)
            rtn = false;
    }

    else
    {
        if (theUlCorner.y > rect.ul().y)
            rtn = false;

        else if (theLrCorner.y < rect.lr().y)
            rtn = false;
    }

    return rtn;
}
开发者ID:whztt07,项目名称:star_ossim,代码行数:52,代码来源:ossimDrect.cpp


示例14: isInsideEdge

bool ossimPolygon::isInsideEdge(const ossimDpt& pt,
                                const ossimDrect& rect,
                                int edge)const
{
   switch(edge)
   {
   case RECT_LEFT_EDGE:
   {
      return (pt.x>rect.ul().x);
      break;
   }
   case RECT_TOP_EDGE:
   {
      if(rect.orientMode() == OSSIM_LEFT_HANDED)
      {
         return (pt.y > rect.ul().y);
      }
      else
      {
         return (pt.y < rect.ul().y);
      }
      break;
   }
   case RECT_RIGHT_EDGE:
   {
      return (pt.x<rect.lr().x);
      
      break;
   }
   case RECT_BOTTOM_EDGE:
   {
      if(rect.orientMode() == OSSIM_LEFT_HANDED)
      {
         return (pt.y < rect.lr().y);
      }
      else
      {
         return (pt.y > rect.lr().y);
      }
      break;
   }
   }
   return false;
}
开发者ID:,项目名称:,代码行数:44,代码来源:


示例15: intersectEdge

void ossimPolygon::intersectEdge(ossimDpt& result,
                                 const ossimLine& segment,
                                 const ossimDrect& rect,
                                 int edge)
{
   ossimLine edgeLine;
   switch(edge)
   {
   case RECT_LEFT_EDGE:
   {
      edgeLine.theP1 = rect.ll();
      edgeLine.theP2 = rect.ul();
      break;
   }
   case RECT_TOP_EDGE:
   {
      edgeLine.theP1 = rect.ul();
      edgeLine.theP2 = rect.ur();
      break;
   }
   case RECT_RIGHT_EDGE:
   {
      edgeLine.theP1 = rect.ur();
      edgeLine.theP2 = rect.lr();
      break;
   }
   case RECT_BOTTOM_EDGE:
   {
      edgeLine.theP1 = rect.lr();
      edgeLine.theP2 = rect.ll();
      break;
   }
   }
   
   result = segment.intersectInfinite(edgeLine);
}
开发者ID:,项目名称:,代码行数:36,代码来源:


示例16: getBounds

void ossimShapeObject::getBoundingRect(ossimDrect& result,
                                       ossimCoordSysOrientMode orient)const
{
   double minx, miny, maxx, maxy;
   
   if(theShape)
   {
      getBounds(minx, miny, maxx, maxy);
      
      if(orient == OSSIM_RIGHT_HANDED)
      {
         result = ossimDrect(minx, maxy, maxx, miny, orient);
      }
      else
      {
         result = ossimDrect(minx, miny, maxx, maxy, orient);         
      }
   }
   else
   {
      result = ossimDrect(0,0,0,0,orient);
      result.makeNan();
   }
}
开发者ID:bradh,项目名称:ossim-plugins,代码行数:24,代码来源:ossimShapeFile.cpp


示例17: return

//*******************************************************************
// Public Method: ossimDrect::clipToRect
//*******************************************************************
ossimDrect ossimDrect::clipToRect(const ossimDrect& rect)const
{
    ossimDrect result;
    result.makeNan();
    if(rect.hasNans() || hasNans())
    {

        return result;
    }

    if (theOrientMode != rect.theOrientMode)
        return (*this);

    double x0 = ossim::max(rect.ul().x, ul().x);
    double x1 = ossim::min(rect.lr().x, lr().x);
    double y0, y1;

    if (theOrientMode == OSSIM_LEFT_HANDED)
    {
        y0 = ossim::max(rect.ll().y, ll().y);
        y1 = ossim::min(rect.ur().y, ur().y);

        if( (x1 < x0) || (y1 < y0) )
            return result;
        else
            result = ossimDrect(x0, y0, x1, y1, theOrientMode);
    }
    else
    {
        y0 = ossim::max(rect.ll().y,ll().y);
        y1 = ossim::min(rect.ur().y,ur().y);
        if((x0 <= x1) && (y0 <= y1))
        {
            result = ossimDrect(x0, y1, x1, y0, theOrientMode);
        }
    }
    return result;
}
开发者ID:whztt07,项目名称:star_ossim,代码行数:41,代码来源:ossimDrect.cpp


示例18: getScaleChangeViewToImage

void ossimImageViewTransform::getScaleChangeViewToImage(ossimDpt& result,
        const ossimDrect& viewRect)
{
    result.makeNan();
    if(!viewRect.hasNans())
    {
        ossimDpt iul;
        ossimDpt iur;
        ossimDpt ilr;
        ossimDpt ill;

        imageToView(viewRect.ul(),
                    iul);
        imageToView(viewRect.ur(),
                    iur);
        imageToView(viewRect.lr(),
                    ilr);
        imageToView(viewRect.ll(),
                    ill);

        if(!iul.hasNans()&&
                !iur.hasNans()&&
                !ilr.hasNans()&&
                !ill.hasNans())
        {

            double deltaTop    = (iul - iur).length();
            double deltaBottom = (ill - ilr).length();
            double deltaRight  = (iur - ilr).length();

            double w = viewRect.width();
            double h = viewRect.height();
            result.x = (deltaTop/w + deltaBottom/w)*.5;
            result.y = (deltaRight/h + deltaRight/h)*.5;
        }
    }
}
开发者ID:whztt07,项目名称:star_ossim,代码行数:37,代码来源:ossimImageViewTransform.cpp


示例19: getScaleChangeImageToView

void ossimImageViewTransform::getScaleChangeImageToView(ossimDpt& result,
        const ossimDrect& imageRect)
{
    result.makeNan();
    if(!imageRect.hasNans())
    {
        ossimDpt vul;
        ossimDpt vur;
        ossimDpt vlr;
        ossimDpt vll;

        imageToView(imageRect.ul(),
                    vul);
        imageToView(imageRect.ur(),
                    vur);
        imageToView(imageRect.lr(),
                    vlr);
        imageToView(imageRect.ll(),
                    vll);

        if(!vul.hasNans()&&
                !vur.hasNans()&&
                !vlr.hasNans()&&
                !vll.hasNans())
        {

            double deltaTop    = (vul - vur).length();
            double deltaBottom = (vll - vlr).length();
            double deltaRight  = (vur - vlr).length();

            double w = imageRect.width();
            double h = imageRect.height();
            result.x = (deltaTop/w + deltaBottom/w)*.5;
            result.y = (deltaRight/h + deltaRight/h)*.5;
        }
    }
}
开发者ID:whztt07,项目名称:star_ossim,代码行数:37,代码来源:ossimImageViewTransform.cpp


示例20: getPath

void ossimFgdcXmlDoc::getBoundingBox(ossimDrect& rect) const
{
   rect.makeNan();
   
   if (isOpen())
   {
      double ll_lat = 0.0;
      double ll_lon = 0.0;
      double lr_lat = 0.0;
      double lr_lon = 0.0;
      double ul_lat = 0.0;
      double ul_lon = 0.0;
      double ur_lat = 0.0;
      double ur_lon = 0.0;
     
      ossimString xpath = "/metadata/idinfo/spdom/lboundng/leftbc";
      bool result = getPath(xpath, ul_lon);
      if (!result)
      {
         xpath = "/metadata/idinfo/spdom/bounding/westbc";
         result = getPath(xpath, ul_lon);
         m_boundInDegree = true;
      }
      if (result)
      {
         ll_lon = ul_lon;
      }
      
      xpath = "/metadata/idinfo/spdom/lboundng/rightbc";
      result = getPath(xpath, ur_lon);
      if (!result)
      {
         xpath = "/metadata/idinfo/spdom/bounding/eastbc";
         result = getPath(xpath, ur_lon);
         m_boundInDegree = true;
      }
      if (result)
      {
         lr_lon = ur_lon;
      }

      xpath = "/metadata/idinfo/spdom/lboundng/bottombc";
      result = getPath(xpath, ll_lat);
      if (!result)
      {
         xpath = "/metadata/idinfo/spdom/bounding/southbc";
         result = getPath(xpath, ll_lat);
         m_boundInDegree = true;
      }
      if (result)
      {
         lr_lat = ll_lat;
      }

      xpath = "/metadata/idinfo/spdom/lboundng/topbc";
      result = getPath(xpath, ul_lat);
      if (!result)
      {
         xpath = "/metadata/idinfo/spdom/bounding/northbc";
         result = getPath(xpath, ul_lat);
         m_boundInDegree = true;
      }
      if (result)
      {
         ur_lat = ul_lat;
      }
      
      rect = ossimDrect(ossimDpt(ul_lon, ul_lat),
                        ossimDpt(ur_lon, ur_lat),
                        ossimDpt(lr_lon, lr_lat),
                        ossimDpt(ll_lon, ll_lat), OSSIM_RIGHT_HANDED); 
   }
}
开发者ID:LucHermitte,项目名称:ossim,代码行数:73,代码来源:ossimFgdcXmlDoc.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ossimFilename类代码示例发布时间:2022-05-31
下一篇:
C++ ossimDpt类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap