Esempio n. 1
0
TEST_F(ColumnTest, shouldReturnValidRangesForNotEqual) {
    constraints.push_back(TypedConstraint<double>::notEqual(0, 12));

    checkForConstraints(Tools::vector<IndexRange>(2, /**/
            IndexRange(0, 4),
            IndexRange(7, 7)));
}
Esempio n. 2
0
ReferenceLookupData::ReferenceLookupData(const PbiRawReferenceData& rawData)
{
    const size_t numEntries = rawData.entries_.size();
    references_.reserve(numEntries);
    for (size_t i = 0; i < numEntries; ++i) {
        const PbiReferenceEntry& entry = rawData.entries_.at(i);
        references_[entry.tId_] = IndexRange(entry.beginRow_, entry.endRow_);
    }
}
Esempio n. 3
0
 // Return a range of scopes for the given closure. The elements of the
 // returned range have type `SILFunction *` and are non-null. Return an empty
 // range for a SILFunction that is not a closure or is a dead closure.
 ScopeRange getClosureScopes(SILFunction *ClosureF) {
   IndexRange indexRange(nullptr, nullptr);
   auto closureScopesPos = closureToScopesMap.find(ClosureF);
   if (closureScopesPos != closureToScopesMap.end()) {
     auto &indexedScopes = closureScopesPos->second;
     indexRange = IndexRange(indexedScopes.begin(), indexedScopes.end());
   }
   return makeOptionalTransformRange(indexRange,
                                     IndexLookupFunc(indexedScopes));
 }
Esempio n. 4
0
bool IndexRangeCache::findRange(GLenum type, unsigned int offset, GLsizei count,
                                RangeUI *outRange) const
{
    IndexRangeMap::const_iterator i = mIndexRangeCache.find(IndexRange(type, offset, count));
    if (i != mIndexRangeCache.end())
    {
        if (outRange)        *outRange = i->second;
        return true;
    }
    else
    {
        if (outRange)        *outRange = RangeUI(0, 0);
        return false;
    }
}
Esempio n. 5
0
IndexRange span(IndexRange lhs, IndexRange rhs) {
    if (lhs.start() <= lhs.end()) {
        if (rhs.start() <= rhs.end()) {
            const SINT start = std::min(lhs.start(), rhs.start());
            const SINT end = std::max(lhs.end(), rhs.end());
            DEBUG_ASSERT(start <= end);
            return IndexRange::between(start, end);
        } else {
            DEBUG_ASSERT(!"Cannot span index ranges with contrary orientations");
        }
    } else {
        if (rhs.start() >= rhs.end()) {
            const SINT start = std::max(lhs.start(), rhs.start());
            const SINT end = std::min(lhs.end(), rhs.end());
            DEBUG_ASSERT(start >= end);
            return IndexRange::between(start, end);
        } else {
            DEBUG_ASSERT(!"Cannot span index ranges with contrary orientations");
        }
    }
    return IndexRange();
}
Esempio n. 6
0
void
IndexRangeList::
fromString( const std::string & stringEncoding )
{
	// clear current data
	this->clear();
	// check if something to be parsed
	if (!stringEncoding.empty()) {
		// check if parsable
		if( ! boost::regex_match(stringEncoding, IndexRangeList::regex, boost::match_perl) ) {
			throw std::runtime_error("IndexRangeList::fromString("+stringEncoding+") uses no valid index range string encoding matching '"+regex.str()+"'");
		}
		// find split position
		size_t startPos = 0, splitPos = std::string::npos;
		while (startPos != splitPos) {
			splitPos = stringEncoding.find(',',startPos);
			// insert interval
			this->insert( IndexRange(stringEncoding.substr(startPos,splitPos-(splitPos==std::string::npos?0:startPos))));
			// update start of next interval encoding to parse
			startPos = splitPos + (splitPos != std::string::npos ? 1 : 0);
		}
	}
}
Esempio n. 7
0
IndexRange ComputeIndexRange(GLenum indexType,
                             const GLvoid *indices,
                             size_t count,
                             bool primitiveRestartEnabled)
{
    switch (indexType)
    {
        case GL_UNSIGNED_BYTE:
            return ComputeTypedIndexRange(static_cast<const GLubyte *>(indices), count,
                                          primitiveRestartEnabled,
                                          GetPrimitiveRestartIndex(indexType));
        case GL_UNSIGNED_SHORT:
            return ComputeTypedIndexRange(static_cast<const GLushort *>(indices), count,
                                          primitiveRestartEnabled,
                                          GetPrimitiveRestartIndex(indexType));
        case GL_UNSIGNED_INT:
            return ComputeTypedIndexRange(static_cast<const GLuint *>(indices), count,
                                          primitiveRestartEnabled,
                                          GetPrimitiveRestartIndex(indexType));
        default:
            UNREACHABLE();
            return IndexRange();
    }
}
Esempio n. 8
0
void IndexRangeCache::addRange(GLenum type, unsigned int offset, GLsizei count, const RangeUI &range)
{
    mIndexRangeCache[IndexRange(type, offset, count)] = range;
}
Esempio n. 9
0
 void checkForConstraints(int left, int right) {
     checkForConstraints(Tools::vector<IndexRange>(1, /**/ IndexRange(left, right)));
 }
Esempio n. 10
0
#include "ExtraKnuckles.h"

const IndexSet pinkyIndices  = IndexSet() /IndexRange(21,41);
const IndexSet ringIndices   = IndexSet() /IndexRange(42,62);
const IndexSet middleIndices = IndexSet() /IndexRange(63,83);
const IndexSet indexIndices  = IndexSet() /IndexRange(84,104);

const IndexSet baseIndices = IndexSet() /IndexRange(0,5);
const IndexSet knuckleIndices = IndexSet() /IndexRange(3,11);
const IndexSet tipIndices = IndexSet() /IndexRange(9,20);

const IndexSet lowerGapIndices = IndexSet() /IndexRange(0,5);
const IndexSet upperGapIndices = IndexSet() /IndexRange(9,14);

const IndexSet blendIndices = IndexSet() /IndexRange(0,5);

const IndexSet allFingerIndices = IndexSet()
/IndexRange(21,41)
/IndexRange(42,62)
/IndexRange(63,83)
/IndexRange(84,104);

string ExtraKnuckles::getName() const {
    return "ExtraKnuckles";
}

void ExtraKnuckles::initialize(){
    ExtraKnuckles::initializeGui();
    this->gui->autoSizeToFitWidgets();
    
	final.load("models/mesh_ExtraKnuckles_final.ply");
Esempio n. 11
0
	virtual IndexRange sink() const
	{
		return IndexRange(0,0);
	}
#include "SwellingFingers.h"

const IndexSet pinkyIndices  = IndexSet() /IndexRange(21,41);
const IndexSet ringIndices   = IndexSet() /IndexRange(42,62);
const IndexSet middleIndices = IndexSet() /IndexRange(63,83);
const IndexSet indexIndices  = IndexSet() /IndexRange(84,104);
const IndexSet thumbIndices  = IndexSet() /IndexRange(0,20);

const IndexSet allFingerIndices = IndexSet()
/IndexRange(21,41)
/IndexRange(42,62)
/IndexRange(63,83)
/IndexRange(84,104)
/IndexRange(0,20);

const IndexSet knuckeIndices = IndexSet() /IndexRange(3,11);

string SwellingFingers::getName() const {
    return "SwellingFingers";
}

void SwellingFingers::initialize(){
    
    timer = 0.0f;
    
    pulseSpeed = 7.0f;
    pulseGapWidth = 0.7f;
    
    swellAmt = 0.0f;
    swellPower = 0.03f;
    
Esempio n. 13
0
	virtual IndexRange skipPosSource( const Index& firstpos)
	{
		return IndexRange(0,0);
	}
Esempio n. 14
0
	IndexRange sink() const
	{
		return m_memberScanner.initialized()
			? IndexRange( m_memberScanner.current()->start, m_memberScanner.current()->end)
			: IndexRange(0,0);
	}
Esempio n. 15
0
	IndexRange source() const
	{
		return m_structureScanner.initialized()
			? IndexRange( m_structureScanner.current()->header_start, m_structureScanner.current()->header_end)
			: IndexRange(0,0);
	}
Esempio n. 16
0
void IndexRangeCache::addRange(GLenum type, unsigned int offset, GLsizei count, const RangeUI &range,
                               unsigned int streamOffset)
{
    mIndexRangeCache[IndexRange(type, offset, count)] = IndexBounds(range, streamOffset);
}
Esempio n. 17
0
	virtual IndexRange source() const
	{
		return IndexRange(0,0);
	}