<commit_before>/******************************************************************************
*       SOFA, Simulation Open-Framework Architecture, development version     *
*                (c) 2006-2016 INRIA, USTL, UJF, CNRS, MGH                    *
*                                                                             *
* This library is free software; you can redistribute it and/or modify it     *
* under the terms of the GNU Lesser General Public License as published by    *
* the Free Software Foundation; either version 2.1 of the License, or (at     *
* your option) any later version.                                             *
*                                                                             *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details.                                                           *
*                                                                             *
* You should have received a copy of the GNU Lesser General Public License    *
* along with this library; if not, write to the Free Software Foundation,     *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.          *
*******************************************************************************
*                              SOFA :: Framework                              *
*                                                                             *
* Contributions:                                                              *
*     - <EMAIL>                                         *
*                                                                             *
* Contact information: <EMAIL>                             *
******************************************************************************/
#ifndef SOFA_DEFAULTTYPE_COLOR_H
#define SOFA_DEFAULTTYPE_COLOR_H
#include <string>

#include <sofa/defaulttype/defaulttype.h>
#include <sofa/defaulttype/Vec.h>

namespace sofa
{

namespace defaulttype
{

/**
 *  \brief encode a 4 RGBA component color as a specialized Vec<4, float> vector.
 */
template<typename T>
class SOFA_DEFAULTTYPE_API TRGBAColor : public Vec<4, T>
{
public:
    static TRGBAColor<T> fromString(const std::string& str) ;
    static TRGBAColor fromDouble(const float r, const float g, const float b, const float a) ;
    static TRGBAColor fromVec4(const Vec4d& color) ;
    static TRGBAColor fromVec4(const Vec4f& color) ;
    static bool read(const std::string& str, TRGBAColor& color) ;

    static TRGBAColor white()  { return TRGBAColor(1.0,1.0,1.0,1.0); }
    static TRGBAColor black()  { return TRGBAColor(0.0,0.0,0.0,1.0); }
    static TRGBAColor red()    { return TRGBAColor(1.0,0.0,0.0,1.0); }
    static TRGBAColor green()  { return TRGBAColor(0.0,1.0,0.0,1.0); }
    static TRGBAColor blue()   { return TRGBAColor(0.0,0.0,1.0,1.0); }
    static TRGBAColor cyan()   { return TRGBAColor(0.0,1.0,1.0,1.0); }
    static TRGBAColor magenta() { return TRGBAColor(1.0,0.0,1.0,1.0); }
    static TRGBAColor yellow()  { return TRGBAColor(1.0,1.0,0.0,1.0); }
    static TRGBAColor gray()    { return TRGBAColor(0.5,0.5,0.5,1.0); }

    using Vec<4,T>::x ;
    using Vec<4,T>::y ;
    using Vec<4,T>::z ;
    using Vec<4,T>::w ;

    float& SOFA_DEFAULTTYPE_API r(){ return x() ; }
    float& SOFA_DEFAULTTYPE_API g(){ return y() ; }
    float& SOFA_DEFAULTTYPE_API b(){ return z() ; }
    float& SOFA_DEFAULTTYPE_API a(){ return w() ; }
    const float& SOFA_DEFAULTTYPE_API r() const { return x() ; }
    const float& SOFA_DEFAULTTYPE_API g() const { return y() ; }
    const float& SOFA_DEFAULTTYPE_API b() const { return z() ; }
    const float& SOFA_DEFAULTTYPE_API a() const { return w() ; }

    void SOFA_DEFAULTTYPE_API r(const float rr){ x()=rr; }
    void SOFA_DEFAULTTYPE_API g(const float rr){ y()=rr; }
    void SOFA_DEFAULTTYPE_API b(const float rr){ z()=rr; }
    void SOFA_DEFAULTTYPE_API a(const float rr){ w()=rr; }

    friend std::istream& operator>>(std::istream& i, TRGBAColor<float>& t) ;

public:
    TRGBAColor() ;
    TRGBAColor(const  Vec4f&) ;
    TRGBAColor(const float r, const float g, const float b, const float a) ;

};

#if defined(SOFA_EXTERN_TEMPLATE) && !defined(SOFA_DEFAULTTYPE_COLOR_CPP)
extern template class SOFA_DEFAULTTYPE_API TRGBAColor<float> ;
#endif

typedef TRGBAColor<float> RGBAColor ;
<commit_msg>Revert "[WIP] linking problem on vs2015"<commit_after>/******************************************************************************
*       SOFA, Simulation Open-Framework Architecture, development version     *
*                (c) 2006-2016 INRIA, USTL, UJF, CNRS, MGH                    *
*                                                                             *
* This library is free software; you can redistribute it and/or modify it     *
* under the terms of the GNU Lesser General Public License as published by    *
* the Free Software Foundation; either version 2.1 of the License, or (at     *
* your option) any later version.                                             *
*                                                                             *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details.                                                           *
*                                                                             *
* You should have received a copy of the GNU Lesser General Public License    *
* along with this library; if not, write to the Free Software Foundation,     *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.          *
*******************************************************************************
*                              SOFA :: Framework                              *
*                                                                             *
* Contributions:                                                              *
*     - <EMAIL>                                         *
*                                                                             *
* Contact information: <EMAIL>                             *
******************************************************************************/
#ifndef SOFA_DEFAULTTYPE_COLOR_H
#define SOFA_DEFAULTTYPE_COLOR_H
#include <string>

#include <sofa/defaulttype/defaulttype.h>
#include <sofa/defaulttype/Vec.h>

namespace sofa
{

namespace defaulttype
{

/**
 *  \brief encode a 4 RGBA component color as a specialized Vec<4, float> vector.
 */
template<typename T>
class SOFA_DEFAULTTYPE_API TRGBAColor : public Vec<4, T>
{
public:
    static TRGBAColor<T> fromString(const std::string& str) ;
    static TRGBAColor fromDouble(const float r, const float g, const float b, const float a) ;
    static TRGBAColor fromVec4(const Vec4d& color) ;
    static TRGBAColor fromVec4(const Vec4f& color) ;
    static bool read(const std::string& str, TRGBAColor& color) ;

    static TRGBAColor white()  { return TRGBAColor(1.0,1.0,1.0,1.0); }
    static TRGBAColor black()  { return TRGBAColor(0.0,0.0,0.0,1.0); }
    static TRGBAColor red()    { return TRGBAColor(1.0,0.0,0.0,1.0); }
    static TRGBAColor green()  { return TRGBAColor(0.0,1.0,0.0,1.0); }
    static TRGBAColor blue()   { return TRGBAColor(0.0,0.0,1.0,1.0); }
    static TRGBAColor cyan()   { return TRGBAColor(0.0,1.0,1.0,1.0); }
    static TRGBAColor magenta() { return TRGBAColor(1.0,0.0,1.0,1.0); }
    static TRGBAColor yellow()  { return TRGBAColor(1.0,1.0,0.0,1.0); }
    static TRGBAColor gray()    { return TRGBAColor(0.5,0.5,0.5,1.0); }

    using Vec<4,T>::x ;
    using Vec<4,T>::y ;
    using Vec<4,T>::z ;
    using Vec<4,T>::w ;

    float& r(){ return x() ; }
    float& g(){ return y() ; }
    float& b(){ return z() ; }
    float& a(){ return w() ; }
    const float& r() const { return x() ; }
    const float& g() const { return y() ; }
    const float& b() const { return z() ; }
    const float& a() const { return w() ; }

    void r(const float r){ x()=r; }
    void g(const float r){ y()=r; }
    void b(const float r){ z()=r; }
    void a(const float r){ w()=r; }

    friend std::istream& operator>>(std::istream& i, TRGBAColor<float>& t) ;

public:
    TRGBAColor() ;
    TRGBAColor(const  Vec4f&) ;
    TRGBAColor(const float r, const float g, const float b, const float a) ;

};

#if defined(SOFA_EXTERN_TEMPLATE) && !defined(SOFA_DEFAULTTYPE_COLOR_CPP)
extern template class SOFA_DEFAULTTYPE_API TRGBAColor<float> ;
#endif

typedef TRGBAColor<float> RGBAColor ;

{'fraction_non_alphanumeric': 0.15506150547342287, 'fraction_numerical': 0.024150773050445773, 'mean_word_length': 2.043269230769231, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 44, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3944988', 'n_tokens_mistral': 2585, 'n_tokens_neox': 2556, 'n_words': 729}