void TypePropertyCache::Cache(
     const PropertyId id,
     const PropertyIndex index,
     const bool isInlineSlot,
     const bool isSetPropertyAllowed)
 {
     elements[ElementIndex(id)].Cache(id, index, isInlineSlot, isSetPropertyAllowed);
 }
示例#2
0
  template <> DLL_HEADER Ng_Element Ng_GetElement<3> (int nr)
  {
    const Element & el = mesh->VolumeElement (ElementIndex (nr));
  
    Ng_Element ret;
    ret.type = NG_ELEMENT_TYPE(el.GetType());
    ret.points.num = el.GetNP();
    ret.points.ptr = (int*)&el[0];

    ret.vertices.num = el.GetNV();
    ret.vertices.ptr = (int*)&(el[0]);

    ret.edges.num = MeshTopology::GetNEdges (el.GetType());
    ret.edges.ptr = mesh->GetTopology().GetElementEdgesPtr (nr);

    ret.faces.num = MeshTopology::GetNFaces (el.GetType());
    ret.faces.ptr = mesh->GetTopology().GetElementFacesPtr (nr);

    return ret;
  }
    void TypePropertyCache::Cache(
        const PropertyId id,
        const PropertyIndex index,
        const bool isInlineSlot,
        const bool isSetPropertyAllowed,
        const bool isMissing,
        DynamicObject *const prototypeObjectWithProperty,
        Type *const myParentType)
    {
        Assert(myParentType);
        Assert(myParentType->GetPropertyCache() == this);

        elements[ElementIndex(id)].Cache(
            id,
            index,
            isInlineSlot,
            isSetPropertyAllowed,
            isMissing,
            prototypeObjectWithProperty,
            myParentType);
    }
    __inline bool TypePropertyCache::TryGetIndexForStore(
        const PropertyId id,
        PropertyIndex *const index,
        bool *const isInlineSlot) const
    {
        Assert(index);
        Assert(isInlineSlot);

        const TypePropertyCacheElement &element = elements[ElementIndex(id)];
        if(element.Id() != id ||
            !element.IsSetPropertyAllowed() ||
            element.PrototypeObjectWithProperty())
        {
            return false;
        }

        Assert(!element.IsMissing());
        *index = element.Index();
        *isInlineSlot = element.IsInlineSlot();
        return true;
    }
示例#5
0
NGX_INLINE DLL_HEADER Ng_Element Ngx_Mesh :: GetElement<3> (int nr) const
{
    const Element & el = mesh->VolumeElement (ElementIndex (nr));

    Ng_Element ret;
    ret.type = NG_ELEMENT_TYPE(el.GetType());
    ret.index = el.GetIndex();
    ret.points.num = el.GetNP();
    ret.points.ptr = (int*)&el[0];

    ret.vertices.num = el.GetNV();
    ret.vertices.ptr = (int*)&(el[0]);

    ret.edges.num = MeshTopology::GetNEdges (el.GetType());
    ret.edges.ptr = (T_EDGE2*)mesh->GetTopology().GetElementEdgesPtr (nr);

    ret.faces.num = MeshTopology::GetNFaces (el.GetType());
    ret.faces.ptr = (T_FACE2*)mesh->GetTopology().GetElementFacesPtr (nr);

    return ret;
}
    __inline bool TypePropertyCache::TryGetIndexForLoad(
        const bool checkMissing,
        const PropertyId id,
        PropertyIndex *const index,
        bool *const isInlineSlot,
        bool *const isMissing,
        DynamicObject * *const prototypeObjectWithProperty) const
    {
        Assert(index);
        Assert(isInlineSlot);
        Assert(isMissing);
        Assert(prototypeObjectWithProperty);

        const TypePropertyCacheElement &element = elements[ElementIndex(id)];
        if(element.Id() != id || !checkMissing && element.IsMissing())
            return false;

        *index = element.Index();
        *isInlineSlot = element.IsInlineSlot();
        *isMissing = checkMissing ? element.IsMissing() : false;
        *prototypeObjectWithProperty = element.PrototypeObjectWithProperty();
        return true;
    }
 void TypePropertyCache::Clear(const PropertyId id)
 {
     TypePropertyCacheElement &element = elements[ElementIndex(id)];
     if(element.Id() == id)
         element.Clear();
 }
 void TypePropertyCache::ClearIfPropertyIsOnAPrototype(const PropertyId id)
 {
     TypePropertyCacheElement &element = elements[ElementIndex(id)];
     if(element.Id() == id && element.PrototypeObjectWithProperty())
         element.Clear();
 }
示例#9
0
NGX_INLINE DLL_HEADER int Ngx_Mesh :: GetElementIndex<3> (int nr) const
{
  return (*mesh)[ElementIndex(nr)].GetIndex();
}
示例#10
0
 DLL_HEADER int Ng_GetElementIndex<3> (int nr)
 {
   return (*mesh)[ElementIndex(nr)].GetIndex();
 }