Ejemplo n.º 1
0
        public bool AttributeSetTestLocal(QLEntity entity, PredicateNode predicateNode) //todo all possible versions
        {
            var secondNode = predicateNode.SecondNode;
            var exAtt      = (predicateNode.FirstNode as AttributeAccessNode).ExAttNode;

            //property present?
            var part = entity.GetPropertyValue(exAtt.Value);

            if (part == null)
            {
                return(false);
            }

            //todo check if un nesting is ok (supports IFC TYPES such as IFCBOOLEAN)
            if (part.QLClass != null)
            {
                part = part.QLClass.QLDirectList[0];
            }

            if (secondNode is CStringNode && TestStringValue(part, secondNode))
            {
                return(true);
            }

            if (secondNode is CNumberNode && TestIntValue(part, secondNode, predicateNode.Compare))
            {
                return(true);
            }

            if (secondNode is CFloatNode && TestFloatValue(part, secondNode, predicateNode.Compare))
            {
                return(true);
            }

            return(false);
        }