const AbstractVector<T>& BoundedReferenceVector<T>::operator /=(const T& rhs)
{

  for (size_t i = getLower(); i <= getUpper(); i++)
  {
    (*this)[i] /= rhs;
  }
  return *this;
}
Esempio n. 2
0
static void scroll( HWND hwnd, int direction, int timeOut ) {

    LONG page_size = getEnd( hwnd ) - getStart( hwnd );
    if ( page_size <= getGranularity( hwnd ) ) {
        page_size = getGranularity( hwnd );
    }
    if ( page_size <= 0 ) {
        page_size = 1;
    }

    LONG delta = 0;
    if ( -1 == direction ) {
        delta = -page_size;
        if ( getStart( hwnd ) + delta < getLower( hwnd ) ) {
            delta = getLower( hwnd ) - getStart( hwnd );
        }
    } else {
        delta = page_size;
        if ( getUpper( hwnd ) < getEnd( hwnd ) + delta ) {
            delta = getUpper( hwnd ) - getEnd( hwnd );
        }
    }

    int start = adjust( hwnd, getStart( hwnd ) + delta );
    int end   = adjust( hwnd, getEnd  ( hwnd ) + delta );
    if ( start != getStart( hwnd ) || end != getEnd( hwnd ) ) {
        setStart( hwnd, start );
        setEnd  ( hwnd, end   );
        invalidateRect( hwnd );
        invalidateCursor();
        notifyParent( hwnd );
    }

    // TODO: discuss SPI_GETKEYBOARDDELAY
    if ( 0 < timeOut ) {
        SetTimer( hwnd, 1, timeOut, 0 );
    }
}
Esempio n. 3
0
static void notifyParent( HWND hwnd, UINT code = 0 ) {         // NM_ code TODO

    NMRANGESLIDER nm = { { 0 } };
    
    nm.hdr.hwndFrom = hwnd;
    nm.hdr.idFrom = GetWindowID( hwnd );
    nm.hdr.code = code;

    nm.rsInfo._lower       = getLower      ( hwnd );
    nm.rsInfo._upper       = getUpper      ( hwnd );
    nm.rsInfo._start       = getStart      ( hwnd );
    nm.rsInfo._end         = getEnd        ( hwnd );
    nm.rsInfo._minRange    = getMinRange   ( hwnd );
    nm.rsInfo._granularity = getGranularity( hwnd );
    
    FORWARD_WM_NOTIFY(
        GetParent( hwnd ), nm.hdr.idFrom, &nm, SNDMSG );
}
Esempio n. 4
0
string DesktopIconConfig::getExtension(const string & file)
{
    string returnString;
    int pos = file.rfind('.', file.size() - 1); //search for '.' from the end

    if (pos == string::npos      || //no '.' is string
        pos == (file.size() - 1) || // '.' is at end of string
        pos == file.size() )        // '.' is at beginning of string 
    {
        cout << "Cannot determine file extension of: " << file << endl;
        returnString = "?";
    }
    else  //grab all of the string that is after the '.'
        returnString = getUpper(file.substr(pos + 1, file.size() - pos));
         
    if(returnString.size() > 3){  //remove all white space
	    while(returnString.size() > 3){
	       returnString =   returnString.substr(0, returnString.size() - 1); 
	    }	    
    }

    return returnString;
}
Esempio n. 5
0
MyConstantRange binaryOr(const MyConstantRange &Other) const {
  if (isEmptySet() || Other.isEmptySet())
    return MyConstantRange(getBitWidth(), /*isFullSet=*/false);

  if (!isWrappedSet() && !Other.isWrappedSet() && !isFullSet() && !Other.isFullSet()) {
    unsigned width1 = ((getUpper() - 1) ^ getLower()).getActiveBits();
    unsigned width2 = ((Other.getUpper() - 1) ^ Other.getLower()).getActiveBits();
    APInt res1 = getLower().lshr(width1) << width1;
    APInt res2 = Other.getLower().lshr(width2) << width2;
    APInt res_high1 = getLower();
    APInt res_high2 = Other.getLower();
    res_high1.setLowBits(width1);
    res_high2.setLowBits(width2);
    if ((res1 | res2).isNullValue() && (res_high1 | res_high2).isAllOnesValue()) {
        return MyConstantRange(getBitWidth(), /*isFullSet=*/true);
    }
    return MyConstantRange(res1 | res2, (res_high1 | res_high2) + 1);
  }

  APInt umax = APIntOps::umax(getUnsignedMin(), Other.getUnsignedMin());
  if (umax.isNullValue())
    return MyConstantRange(getBitWidth(), /*isFullSet=*/true);
  return MyConstantRange(std::move(umax), APInt::getNullValue(getBitWidth()));
}
Esempio n. 6
0
MyConstantRange binaryAnd(const ConstantRange &Other) const {
  if (isEmptySet() || Other.isEmptySet())
    return MyConstantRange(getBitWidth(), /*isFullSet=*/false);

  if (!isWrappedSet() && !Other.isWrappedSet() && !isFullSet() && !Other.isFullSet()) {
    unsigned width1 = ((getUpper() - 1) ^ getLower()).logBase2() + 1;
    unsigned width2 = ((Other.getUpper() - 1) ^ Other.getLower()).logBase2() + 1;
    APInt res1 = getLower().lshr(width1) << width1;
    APInt res2 = Other.getLower().lshr(width2) << width2;
    APInt res_high1 = getLower();
    APInt res_high2 = Other.getLower();
    res_high1.setLowBits(width1);
    res_high2.setLowBits(width2);
    if ((res1 & res2).isNullValue() && (res_high1 & res_high2).isAllOnesValue()) {
        return MyConstantRange(getBitWidth(), /*isFullSet=*/true);
    }
    return MyConstantRange(res1 & res2, (res_high1 & res_high2) + 1);
  }

  APInt umin = APIntOps::umin(Other.getUnsignedMax(), getUnsignedMax());
  if (umin.isAllOnesValue())
    return MyConstantRange(getBitWidth(), /*isFullSet=*/true);
  return MyConstantRange(APInt::getNullValue(getBitWidth()), std::move(umin) + 1);
}
Esempio n. 7
0
static void onKey(
    HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags )
{
    long start = getStart( hwnd );
    long end   = getEnd( hwnd );

    const BOOL controlKey = GetAsyncKeyState( VK_CONTROL ) < 0;

    if ( VK_ESCAPE == vk ) {
        if ( htNone != getHTCode( hwnd ) ) {
            setHTCode( hwnd, htNone );
            const LONG oldStart = getSaveStart( hwnd );
            const LONG oldEnd   = getSaveEnd  ( hwnd );
            setStart( hwnd, oldStart );
            setEnd  ( hwnd, oldEnd   );
            invalidateRect( hwnd );
            //onLButtonUp( hwnd, 0, 0, 0 ); // TODO retain capture anyway?
            // TODO notify parent
            return; //** FUNCTION EXIT POINT
        }
    }

    const UINT left_key  = isVertical( hwnd ) ? VK_UP   : VK_LEFT ;
    const UINT right_key = isVertical( hwnd ) ? VK_DOWN : VK_RIGHT;

    long granularity = getGranularity( hwnd );
    if ( granularity <= 0 ) {
        granularity = 1;
    }

    if ( left_key == vk ) {
        if ( controlKey ) {
            if ( getMinRange( hwnd ) < end - start ) {
                end -= granularity;
            }
        } else if ( getLower( hwnd ) < start ) {
            start -= granularity;
            end   -= granularity;
        }
    } else if ( right_key == vk ) {
        if ( end < getUpper( hwnd ) ) {
            end += granularity;
            if ( !controlKey ) {
                start += granularity;
            }
        }
    } else if ( VK_PRIOR == vk ) {
        scroll( hwnd, -1, 0 );
        return; //*** FUNCTION EXIT POINT
    } else if ( VK_NEXT == vk ) {
        scroll( hwnd, 1, 0 );
        return; //*** FUNCTION EXIT POINT
    } else if ( VK_HOME == vk ) {
        const long range = abs( getLower( hwnd ) - start );
        start -= range;
        end   -= range;
    } else if ( VK_END == vk ) {
        const long range = abs( getUpper( hwnd ) - end );
        start += range;
        end   += range;
    }

    start = adjust( hwnd, start );
    end   = adjust( hwnd, end   );
    if ( start != getStart( hwnd ) || end != getEnd( hwnd ) ) {
        setStart( hwnd, start );
        setEnd  ( hwnd, end );
        invalidateRect( hwnd );
        invalidateCursor();
        notifyParent( hwnd );
    }
}
Esempio n. 8
0
inline LONG getRange( HWND hwnd ) {

    return getUpper( hwnd ) - getLower( hwnd );
}
Esempio n. 9
0
void CommonOptions::setOptions(Table t)
{
    table = t;

    //font options
    if (table.Query("FontName") != "")
        fontName = table.Query("FontName"); 
    if (table.Query("FontSize") != "")
        fontSize = atoi(table.Query("FontSize").c_str());
	if (fontSize>256)
	    fontSize = 16;
    if (table.Query("FontColor") != "")
        fontColor = table.Query("FontColor"); 

    //click options
    if (table.Query("ClickDelay") != "")
        clickDelay = atoi(table.Query("ClickDelay").c_str());

    //shadow fonts
    if (getUpper(table.Query("Shadow")) == "TRUE")
        shadowOn = true;
    else if (getUpper(table.Query("Shadow")) == "FALSE")
        shadowOn = false;

    if (table.Query("ShadowColor") != "")
        shadowColor = table.Query("ShadowColor");
    if (table.Query("ShadowX") != "")
        shadowX = atoi(table.Query("ShadowX").c_str());
    if (table.Query("ShadowY") != "")
        shadowY = atoi(table.Query("ShadowY").c_str());
    
    //boldness
    if (getUpper(table.Query( "Bold" )) == "TRUE")
        isBold = true;
    else if (getUpper(table.Query( "Bold" )) == "FALSE")
        isBold = false;

    //snap shadow
    if (getUpper(table.Query("SnapShadow")) == "TRUE")
        snapShadow = true;
    else if (getUpper(table.Query("SnapShadow")) == "FALSE")
        snapShadow = false;

    if (table.Query("SnapShadowTrans") != "")
        snapShadowTrans = atoi(table.Query("SnapShadowTrans").c_str());

    //captionOnHover
    if (getUpper(table.Query("CaptionOnHover")) == "TRUE")
        captionOnHover = true;
    else if (getUpper(table.Query("CaptionOnHover")) == "FALSE")
        captionOnHover = false;
       

    //captionPlacement
    if (getUpper(table.Query("CaptionPlacement")) == "BOTTOM")
        captionPlacement = "Bottom";
    else if (getUpper(table.Query("CaptionPlacement")) == "TOP")
        captionPlacement = "Top";
    else if (getUpper(table.Query("CaptionPlacement")) == "LEFT")
        captionPlacement = "Left";
    else if (getUpper(table.Query("CaptionPlacement")) == "RIGHT")
        captionPlacement = "Right";
    
   
    //fillStyle
    if (getUpper(table.Query("FillStyle")) == "FILLINVERT")
	    fillStyle = "FillInvert";
    else if (getUpper(table.Query("FillStyle")) == "FILLHLINE")
	    fillStyle = "FillHLine";
    else if (getUpper(table.Query("FillStyle")) == "FILLVLINE")
	    fillStyle = "FillVLine";
    else if (getUpper(table.Query("FillStyle")) == "None")
	    fillStyle = "None";

    //Cursor
    if (getUpper(table.Query("CursorOver")) == "X_CURSOR")
	    cursorOver = XC_X_cursor;
    else if (getUpper(table.Query("CursorOver")) == "ARROW")
	    cursorOver = XC_arrow;
    else if (getUpper(table.Query("CursorOver")) == "BASED_ARROW_DOWN")
	    cursorOver = XC_based_arrow_down;
    else if (getUpper(table.Query("CursorOver")) == "BASED_ARROW_UP")
	    cursorOver = XC_based_arrow_up;
    else if (getUpper(table.Query("CursorOver")) == "BOAT")
	    cursorOver = XC_boat;
    else if (getUpper(table.Query("CursorOver")) == "BOGOSiTY")
	    cursorOver = XC_bogosity;
    else if (getUpper(table.Query("CursorOver")) == "BOTTOM_LEFT_CORNER")
	    cursorOver = XC_bottom_left_corner;
    else if (getUpper(table.Query("CursorOver")) == "BOTTOM_RIGHT_CORNER")
	    cursorOver =  XC_bottom_right_corner;
    else if (getUpper(table.Query("CursorOver")) == "BOTTOM_SIDE")
	    cursorOver = XC_bottom_side;
    else if (getUpper(table.Query("CursorOver")) == "BOTTOM_TEE")
	    cursorOver = XC_bottom_tee;
    else if (getUpper(table.Query("CursorOver")) == "BOX_SPIRAL")
	    cursorOver =  XC_box_spiral;
    else if (getUpper(table.Query("CursorOver")) == "CENTER_PTR")
	    cursorOver = XC_center_ptr;
    else if (getUpper(table.Query("CursorOver")) == "CIRCLE")
	    cursorOver = XC_circle;
    else if (getUpper(table.Query("CursorOver")) == "CLOCK")
	    cursorOver = XC_clock;
    else if (getUpper(table.Query("CursorOver")) == "COFFE_MUG")
	    cursorOver = XC_coffee_mug;
    else if (getUpper(table.Query("CursorOver")) == "CROSS")
	    cursorOver = XC_cross;
    else if (getUpper(table.Query("CursorOver")) == "CROSS_REVERSE")
	    cursorOver = XC_cross_reverse;
    else if (getUpper(table.Query("CursorOver")) == "CROSSHAIR")
	    cursorOver = XC_crosshair;
    else if (getUpper(table.Query("CursorOver")) == "DIAMOND_CROSS")
	    cursorOver = XC_diamond_cross;
    else if (getUpper(table.Query("CursorOver")) == "DOT")
	    cursorOver = XC_dot;
    else if (getUpper(table.Query("CursorOver")) == "DOTBOX")
	    cursorOver = XC_dotbox;
    else if (getUpper(table.Query("CursorOver")) == "DOUBLE_ARROW")
	    cursorOver = XC_double_arrow;
    else if (getUpper(table.Query("CursorOver")) == "DRAFT_LARGE")
	    cursorOver = XC_draft_large;
    else if (getUpper(table.Query("CursorOver")) == "DRAFT_SMALL")
	    cursorOver = XC_draft_small;
    else if (getUpper(table.Query("CursorOver")) == "DRAPED_BOX")
	    cursorOver = XC_draped_box;
    else if (getUpper(table.Query("CursorOver")) == "EXCHANGE")
	    cursorOver = XC_exchange;
    else if (getUpper(table.Query("CursorOver")) == "FLEUR")
	    cursorOver =  XC_fleur;
    else if (getUpper(table.Query("CursorOver")) == "GOBBLER")
	    cursorOver = XC_gobbler;
    else if (getUpper(table.Query("CursorOver")) == "GUMBY")
	    cursorOver = XC_gumby;
    else if (getUpper(table.Query("CursorOver")) == "HAND1")
	    cursorOver = XC_hand1;
    else if (getUpper(table.Query("CursorOver")) == "HAND2")
	    cursorOver = XC_hand2;
    else if (getUpper(table.Query("CursorOver")) == "HEART")
	    cursorOver = XC_heart;
    else if (getUpper(table.Query("CursorOver")) == "ICON")
	    cursorOver = XC_icon;
    else if (getUpper(table.Query("CursorOver")) == "IRON_CROSS")
	    cursorOver = XC_iron_cross;
    else if (getUpper(table.Query("CursorOver")) == "LEFT_PTR")
	    cursorOver = XC_left_ptr;
    else if (getUpper(table.Query("CursorOver")) == "LEFT_PTR")
	    cursorOver = XC_left_side;
    else if (getUpper(table.Query("CursorOver")) == "LEFT_TEE")
	    cursorOver = XC_left_tee;
    else if (getUpper(table.Query("CursorOver")) == "LEFFBUTTON")
	    cursorOver = XC_leftbutton;
    else if (getUpper(table.Query("CursorOver")) == "LL_ANGLE")
	    cursorOver = XC_ll_angle;
    else if (getUpper(table.Query("CursorOver")) == "LR_ANGLE")
	    cursorOver = XC_lr_angle;
    else if (getUpper(table.Query("CursorOver")) == "MAN")
	    cursorOver = XC_man;
    else if (getUpper(table.Query("CursorOver")) == "MIDDLEBUTTON")
	    cursorOver = XC_middlebutton;
    else if (getUpper(table.Query("CursorOver")) == "MOUSE")
	    cursorOver = XC_mouse;
    else if (getUpper(table.Query("CursorOver")) == "PENCIL")
	    cursorOver = XC_pencil;
    else if (getUpper(table.Query("CursorOver")) == "PIRATE")
	    cursorOver = XC_pirate;
    else if (getUpper(table.Query("CursorOver")) == "PLUS")
	    cursorOver = XC_plus;
    else if (getUpper(table.Query("CursorOver")) == "QUESTION_ARROW")
	    cursorOver = XC_question_arrow;
    else if (getUpper(table.Query("CursorOver")) == "RIGHT_PTR")
	    cursorOver = XC_right_ptr;
    else if (getUpper(table.Query("CursorOver")) == "RIGHT_SIDE")
	    cursorOver = XC_right_side;
    else if (getUpper(table.Query("CursorOver")) == "RIGHT_TEE")
	    cursorOver = XC_right_tee;
    else if (getUpper(table.Query("CursorOver")) == "RIGHTBUTTON")
	    cursorOver = XC_rightbutton;
    else if (getUpper(table.Query("CursorOver")) == "RTL_LOGO")
	    cursorOver = XC_rtl_logo;
    else if (getUpper(table.Query("CursorOver")) == "SAILBOAT")
	    cursorOver = XC_sailboat;
    else if (getUpper(table.Query("CursorOver")) == "SB_DOWN_ARROW")
	    cursorOver = XC_sb_down_arrow;
    else if (getUpper(table.Query("CursorOver")) == "SB_H_DOUBLE_ARROW")
	    cursorOver = XC_sb_h_double_arrow;
    else if (getUpper(table.Query("CursorOver")) == "SB_LEFT_ARROW")
	    cursorOver = XC_sb_left_arrow;
    else if (getUpper(table.Query("CursorOver")) == "SB_RIGHT_ARROW")
	    cursorOver = XC_sb_right_arrow;
    else if (getUpper(table.Query("CursorOver")) == "SB_UP_ARROW")
	    cursorOver = XC_sb_up_arrow;
    else if (getUpper(table.Query("CursorOver")) == "SB_V_DOUBLE_ARROW")
	    cursorOver = XC_sb_v_double_arrow;
    else if (getUpper(table.Query("CursorOver")) == "SHUTTLE")
	    cursorOver = XC_shuttle;
    else if (getUpper(table.Query("CursorOver")) == "SIZING")
	    cursorOver = XC_sizing;
    else if (getUpper(table.Query("CursorOver")) == "SPIDER")
	    cursorOver = XC_spider;
    else if (getUpper(table.Query("CursorOver")) == "SPRAYCAN")
	    cursorOver = XC_spraycan;
    else if (getUpper(table.Query("CursorOver")) == "STAR")
	    cursorOver = XC_star;
    else if (getUpper(table.Query("CursorOver")) == "TARGET")
	    cursorOver = XC_target;
    else if (getUpper(table.Query("CursorOver")) == "TCROSS")
	    cursorOver = XC_tcross;
    else if (getUpper(table.Query("CursorOver")) == "TOP_LEFT_ARROW")
	    cursorOver = XC_top_left_arrow;
    else if (getUpper(table.Query("CursorOver")) == "TOP_LEFT_CORNER")
	    cursorOver = XC_top_left_corner;
    else if (getUpper(table.Query("CursorOver")) == "TOP_RIGHT_CORNER")
	    cursorOver = XC_top_right_corner;
    else if (getUpper(table.Query("CursorOver")) == "TOP_SIDE")
	    cursorOver = XC_top_side;
    else if (getUpper(table.Query("CursorOver")) == "TOP_TEE")
	    cursorOver = XC_top_tee;
    else if (getUpper(table.Query("CursorOver")) == "TREK")
	    cursorOver = XC_trek;
    else if (getUpper(table.Query("CursorOver")) == "UL_ANGLE")
	    cursorOver = XC_ul_angle;
    else if (getUpper(table.Query("CursorOver")) == "UMBRELLA")
	    cursorOver = XC_umbrella;
    else if (getUpper(table.Query("CursorOver")) == "UR_ANGLE")
	    cursorOver = XC_ur_angle;
    else if (getUpper(table.Query("CursorOver")) == "WATCH")
	    cursorOver = XC_watch;
    else if (getUpper(table.Query("CursorOver")) == "XTERM")
	    cursorOver = XC_xterm;
}
Esempio n. 10
0
      void
      ForceBoundary::applyBoundary()
      {

        std::list<Molecule *> mol;
        std::list<Molecule *>::iterator mi;
        Molecule *m;
        double distanceVector[3];
        //double cornerA[3];
        //double cornerB[3];
        double f[3];
        f[0] = 0;

        /*	cornerA[X] = bBoxMin[X];
         cornerA[Y] = bBoxMin[Y];
         cornerA[Z] = bBoxMin[Z];

         cornerB[X] = bBoxMin[X]+_borderSize[X];
         cornerB[Y] = bBoxMax[Y];
         cornerB[Z] = bBoxMax[Z];


         _moleculeContainer->getRegion(cornerA, cornerB,mol);*/
        getLower(X, mol);
        for (mi = mol.begin(); mi != mol.end(); mi++)
          {
            m = (*mi);
            f[X] = calcFm(m->r(X) - bBoxMin[X]) * fmplus;
            f[Y] = 0;
            f[Z] = 0;
            /*	double r =m->r(X)-bBoxMin[X];
             if(r<0.5) {
             std::cout << m->F(0) << " "<<m->F(1) << " "<<m->F(2) << " X"<< std::endl;

             }*/

            m->Fadd(f);
            /*	if(r<0.5) {
             std::cout << r << " " <<m->F(0) << " "<<m->F(1) << " "<<m->F(2) << " X2"<< std::endl;

             }*/
            if (_RBinFB)
              {
                Molecule dummy(*m);
                dummy.move(X, -2 * m->r(X));
                double dd = dummy.dist2(*m, distanceVector);
                if (dd < 2.0)
                  {
                    std::cout << m->F(0) << " " << m->F(1) << " " << m->F(2)
                        << " X" << std::endl;
                    _particlePairsHandler->processPair(*m, dummy,
                        distanceVector, MOLECULE_HALOMOLECULE, dd, (dd
                            < _LJCutoffRadiusSquare));
                    m->calcFM();
                    std::cout << dd << " " << m->F(0) << " " << m->F(1) << " "
                        << m->F(2) << " X2" << std::endl;
                  }

              }

          }

        mol.clear();
        /*cornerA[X] = bBoxMax[X]-_borderSize[X];
         cornerB[X] = bBoxMax[X];

         _moleculeContainer->getRegion(cornerA, cornerB,mol);*/
        getUpper(X, mol);
        for (mi = mol.begin(); mi != mol.end(); mi++)
          {
            m = (*mi);
            f[X] = -calcFm(bBoxMax[X] - m->r(X)) * fmplus;
            if (_streamOutDir == X)
              f[X] *= _fStreamDamping;
            if (!_fStream || _streamOutDir != X)
              m->Fadd(f);
            if (_RBinFB && _streamOutDir != X)
              {
                Molecule dummy(*m);
                dummy.move(X, 2 * (m->r(X) - _domain->getGlobalLength(X)));
                double dd = dummy.dist2(*m, distanceVector);
                _particlePairsHandler->processPair(*m, dummy, distanceVector,
                    MOLECULE_HALOMOLECULE, dd, (dd < _LJCutoffRadiusSquare));
                //std::cout << dummy.F(0) << " "<<dummy.F(1) << " "<<dummy.F(2) << " -X"<< std::endl;

              }
          }

        mol.clear();
        /*	cornerA[X] = bBoxMin[X];
         cornerB[X] = bBoxMax[X];
         cornerB[Y] = bBoxMin[Y]+_borderSize[Y];

         _moleculeContainer->getRegion(cornerA, cornerB,mol);*/
        getLower(Y, mol);
        for (mi = mol.begin(); mi != mol.end(); mi++)
          {
            m = (*mi);
            f[X] = 0;
            f[Y] = calcFm(m->r(Y) - bBoxMin[Y]) * fmplus;
            m->Fadd(f);
            if (_RBinFB)
              {
                Molecule dummy(*m);
                dummy.move(Y, -2 * m->r(Y));
                double dd = dummy.dist2(*m, distanceVector);
                _particlePairsHandler->processPair(*m, dummy, distanceVector,
                    MOLECULE_HALOMOLECULE, dd, (dd < _LJCutoffRadiusSquare));
              }
          }

        mol.clear();
        /*	cornerA[Y] = bBoxMax[Y]-_borderSize[Y];
         cornerB[Y] = bBoxMax[Y];

         _moleculeContainer->getRegion(cornerA, cornerB,mol);*/
        getUpper(Y, mol);
        for (mi = mol.begin(); mi != mol.end(); mi++)
          {
            m = (*mi);
            f[Y] = -calcFm(bBoxMax[Y] - m->r(Y)) * fmplus;
            if (_streamOutDir == Y)
              f[Y] *= _fStreamDamping;
            if (!_fStream || _streamOutDir != Y)
              m->Fadd(f);
            if (_RBinFB && _streamOutDir != Y)
              {
                Molecule dummy(*m);
                dummy.move(Y, 2 * (m->r(Y) - _domain->getGlobalLength(Y)));
                double dd = dummy.dist2(*m, distanceVector);
                _particlePairsHandler->processPair(*m, dummy, distanceVector,
                    MOLECULE_HALOMOLECULE, dd, (dd < _LJCutoffRadiusSquare));
                //	 std::cout << dummy.F(0) << " "<<dummy.F(1) << " "<<dummy.F(2) << " -Y"<< std::endl;

              }
          }
        if (_dim == 3)
          {
            mol.clear();
            /*cornerA[Y] = bBoxMin[Y];
             cornerB[Y] = bBoxMax[Y];
             cornerB[Z] = bBoxMin[Z]+_borderSize[Z];

             _moleculeContainer->getRegion(cornerA, cornerB,mol);*/
            getLower(Z, mol);

            for (mi = mol.begin(); mi != mol.end(); mi++)
              {
                m = (*mi);
                f[Y] = 0;
                f[Z] = calcFm(m->r(Z) - bBoxMin[Z]) * fmplus;
                m->Fadd(f);
                if (_RBinFB)
                  {
                    Molecule dummy(*m);
                    dummy.move(Z, -2 * m->r(Z));
                    double dd = dummy.dist2(*m, distanceVector);
                    _particlePairsHandler->processPair(*m, dummy,
                        distanceVector, MOLECULE_HALOMOLECULE, dd, (dd
                            < _LJCutoffRadiusSquare));
                    // std::cout << dummy.F(0) << " "<<dummy.F(1) << " "<<dummy.F(2) << " "<< std::endl;
                  }
              }

            mol.clear();
            /*cornerA[Z] = bBoxMax[Z]-_borderSize[Z];
             cornerB[Z] = bBoxMax[Z];

             _moleculeContainer->getRegion(cornerA, cornerB,mol);*/
            getUpper(Z, mol);
            for (mi = mol.begin(); mi != mol.end(); mi++)
              {
                m = (*mi);
                f[Z] = -calcFm(bBoxMax[Z] - m->r(Z)) * fmplus;
                if (_streamOutDir == Z)
                  f[Z] *= _fStreamDamping;
                if (!_fStream || _streamOutDir != Z)
                  m->Fadd(f);
                if (_RBinFB && _streamOutDir != Z)
                  {
                    Molecule dummy(*m);
                    dummy.move(Z, 2 * (m->r(Z) - _domain->getGlobalLength(Z)));
                    double dd = dummy.dist2(*m, distanceVector);
                    _particlePairsHandler->processPair(*m, dummy,
                        distanceVector, MOLECULE_HALOMOLECULE, dd, (dd
                            < _LJCutoffRadiusSquare));

                  }
              }
          }

      }