Exemplo n.º 1
0
 public override void QueryEnvelope(com.epl.geometry.Envelope env)
 {
     env.SetEmpty();
     if (m_description != env.m_description)
     {
         env.AssignVertexDescription(m_description);
     }
     env.Merge(this);
 }
 // Checked vs. Jan 11, 2011
 /// <param name="bExact">
 /// True, when the exact envelope need to be calculated and false
 /// for the loose one.
 /// </param>
 protected internal virtual void _updateAllDirtyIntervals(bool bExact)
 {
     _verifyAllStreams();
     if (_hasDirtyFlag(com.epl.geometry.MultiVertexGeometryImpl.DirtyFlags.DirtyIntervals))
     {
         if (null == m_envelope)
         {
             m_envelope = new com.epl.geometry.Envelope(m_description);
         }
         else
         {
             m_envelope.AssignVertexDescription(m_description);
         }
         if (IsEmpty())
         {
             m_envelope.SetEmpty();
             return;
         }
         _updateXYImpl(bExact);
         // efficient method for xy's
         // now go through other attribues.
         for (int attributeIndex = 1; attributeIndex < m_description.GetAttributeCount(); attributeIndex++)
         {
             int semantics = m_description._getSemanticsImpl(attributeIndex);
             int ncomps    = com.epl.geometry.VertexDescription.GetComponentCount(semantics);
             com.epl.geometry.AttributeStreamBase stream = m_vertexAttributes[attributeIndex];
             for (int iord = 0; iord < ncomps; iord++)
             {
                 com.epl.geometry.Envelope1D interval = new com.epl.geometry.Envelope1D();
                 interval.SetEmpty();
                 for (int i = 0; i < m_pointCount; i++)
                 {
                     double value = stream.ReadAsDbl(i * ncomps + iord);
                     // some
                     // optimization
                     // is
                     // possible
                     // if
                     // non-virtual
                     // method
                     // is
                     // used
                     interval.Merge(value);
                 }
                 m_envelope.SetInterval(semantics, iord, interval);
             }
         }
         if (bExact)
         {
             _setDirtyFlag(com.epl.geometry.MultiVertexGeometryImpl.DirtyFlags.DirtyIntervals, false);
         }
     }
 }
Exemplo n.º 3
0
 public override void QueryEnvelope(com.epl.geometry.Envelope env)
 {
     env.SetEmpty();
     env.AssignVertexDescription(m_description);
     com.epl.geometry.Envelope2D env2D = new com.epl.geometry.Envelope2D();
     QueryEnvelope2D(env2D);
     env.SetEnvelope2D(env2D);
     for (int i = 1, n = m_description.GetAttributeCount(); i < n; i++)
     {
         int semantics = m_description.GetSemantics(i);
         for (int iord = 0, nord = com.epl.geometry.VertexDescription.GetComponentCount(semantics); i < nord; i++)
         {
             com.epl.geometry.Envelope1D interval = QueryInterval(semantics, iord);
             env.SetInterval(semantics, iord, interval);
         }
     }
 }