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


C++ ossimDrect类代码示例

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


在下文中一共展示了ossimDrect类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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,代码来源:


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